Ocena wątku:
- 0 głosów - średnia: 0
- 1
- 2
- 3
- 4
- 5
problem z plikiem public html
|
Liczba postów: 27
Liczba wątków: 8
Dołączył: 06-02-2012
Reputacja:
0
nie mogę wczytać wordpressa bo wyskakuje mi taki oto komunikat:
Parse error: syntax error, unexpected T_STRING in /home/tomek5/public_html/wp-content/themes/zbench/functions.php on line 54
nie mam pojęcia co to znaczy
jedyne co zrobiłem to tylko we właściwościach pliku index html wybrałem opcję otwórz za pomocą notatnika,
i od tamtej pory wyskakuje mi ten komunikat
co z tym zrobić?
Liczba postów: 69
Liczba wątków: 2
Dołączył: 14-02-2012
Reputacja:
3
Pobierz szablon, który używasz i przeżuć na serwer plik function.php
Liczba postów: 27
Liczba wątków: 8
Dołączył: 06-02-2012
Reputacja:
0
24-03-2012, 15:10
(Ten post był ostatnio modyfikowany: 24-03-2012, 15:38 przez wecvrtmb.)
mogę ten szablon pobrać z jakiejś strony?
bo na chwilę obecną nie mama dostępu do wordpressa
ok, już pobrałem, szablon,
przerzuciłem go w odpowiednie miejsce do wp-content
i problem nadal jest
P.S. a tak w ogóle to ten plik edytuję w notatniuku, to dobrze?
Liczba postów: 393
Liczba wątków: 0
Dołączył: 04-06-2010
Reputacja:
15
a co masz w linii 54 w pliku functions.php
Liczba postów: 27
Liczba wątków: 8
Dołączył: 06-02-2012
Reputacja:
0
24-03-2012, 18:07
(Ten post był ostatnio modyfikowany: 24-03-2012, 20:58 przez wecvrtmb.)
w linii 54 jest $GLOBALS['comment'] = $comment;
wstawiam cały kod żeby nie było wątpliwości
Kod: <?php
//////// Widgetized Sidebar.
function zbench_widgets_init() {
register_sidebar(array(
'name' => __('Primary Widget Area','zbench'),
'id' => 'primary-widget-area',
'description' => __('The primary widget area','zbench'),
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3 class="widgettitle">',
'after_title' => '</h3>'
));
register_sidebar(array(
'name' => __('Singular Widget Area','zbench'),
'id' => 'singular-widget-area',
'description' => __('The singular widget area','zbench'),
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3 class="widgettitle">',
'after_title' => '</h3>'
));
register_sidebar(array(
'name' => __('Not Singular Widget Area','zbench'),
'id' => 'not-singular-widget-area',
'description' => __('Not the singular widget area','zbench'),
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3 class="widgettitle">',
'after_title' => '</h3>'
));
register_sidebar(array(
'name' => __('Footer Widget Area','zbench'),
'id' => 'footer-widget-area',
'description' => __('The footer widget area','zbench'),
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3 class="widgettitle">',
'after_title' => '</h3>'
));
}
add_action( 'widgets_init', 'zbench_widgets_init' );
add_action('wp_head', 'iworks_only_one_category');
function iworks_only_one_category()
{
if ( is_home() || is_front_page() ) {
global $wp_query;
$wp_query->query('cat="10");
}
}
//////// Custom Comments List.
function zbench_mytheme_comment($comment, $args, $depth) {
$GLOBALS['comment'] = $comment;
switch ($pingtype=$comment->comment_type) {
case 'pingback' :
case 'trackback' : ?>
<li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
<div id="comment-<?php comment_ID(); ?>">
<div class="comment-author vcard pingback">
<cite class="fn zbench_pingback"><?php comment_author_link(); ?> - <?php echo $pingtype; ?> on <?php printf(__('%1$s at %2$s', 'zbench'), get_comment_date(), get_comment_time()); ?></cite>
</div>
</div>
<?php
break;
default : ?>
<li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
<div id="comment-<?php comment_ID(); ?>">
<div class="comment-author vcard">
<?php echo get_avatar($comment,$size='40',$default='' ); ?>
<cite class="fn"><?php comment_author_link(); ?></cite>
<span class="comment-meta commentmetadata"><a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ); ?>"><?php printf(__('%1$s at %2$s', 'zbench'), get_comment_date(), get_comment_time()); ?></a><?php edit_comment_link(__('[Edit]','zbench'),' ',''); ?></span>
</div>
<div class="comment-text">
<?php comment_text(); ?>
<?php if ($comment->comment_approved == '0') : ?>
<p><em class="approved"><?php _e('Your comment is awaiting moderation.','zbench'); ?></em></p>
<?php endif; ?>
</div>
<div class="reply">
<?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))); ?>
</div>
</div>
<?php break;
}
}
//////// wp_list_comments()->pings callback
function zbench_custom_pings($comment, $args, $depth) {
$GLOBALS['comment'] = $comment;
if('pingback' == get_comment_type()) $pingtype = 'Pingback';
else $pingtype = 'Trackback';
?>
<li id="comment-<?php echo $comment->comment_ID ?>">
<?php comment_author_link(); ?> - <?php echo $pingtype; ?> on <?php echo mysql2date('Y/m/d/ H:i', $comment->comment_date); ?>
<?php }
//////// Set the content width based on the theme's design and stylesheet.
if ( ! isset( $content_width ) )
$content_width = 620;
//////// WP nav menu
register_nav_menus(array('primary' => 'Primary Navigation'));
//////// Custom wp_list_pages
function zbench_wp_list_pages(){
echo '<ul>' , wp_list_pages('title_li=') , '</ul>';
}
//////// LOCALIZATION
load_theme_textdomain('zbench', get_template_directory() . '/lang');
//////// custom excerpt
function zbench_excerpt_length( $length ) {
return 40;
}
add_filter( 'excerpt_length', 'zbench_excerpt_length' );
//Returns a "Read more »" link for excerpts
function zbench_continue_reading_link() {
return '<p class="read-more"><a href="'. esc_url(get_permalink()) . '">' . __( 'Read more »', 'zbench' ) . '</a></p>';
}
//Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis and zbench_continue_reading_link().
function zbench_auto_excerpt_more( $more ) {
return ' …' . zbench_continue_reading_link();
}
add_filter( 'excerpt_more', 'zbench_auto_excerpt_more' );
//Adds a pretty "Read more »" link to custom post excerpts.
function zbench_custom_excerpt_more( $output ) {
if ( has_excerpt() && ! is_attachment() ) {
$output .= zbench_continue_reading_link();
}
return $output;
}
add_filter( 'get_the_excerpt', 'zbench_custom_excerpt_more' );
//Custom more-links for zBench
function zbench_custom_more_link($link) {
return '<span class="zbench-more-link">'.$link.'</span>';
}
add_filter('the_content_more_link', 'zbench_custom_more_link');
//////// Tell WordPress to run zbench_setup() when the 'after_setup_theme' hook is run.
add_action( 'after_setup_theme', 'zbench_setup' );
if ( ! function_exists( 'zbench_setup' ) ):
function zbench_setup() {
// Add default posts and comments RSS feed links to head
add_theme_support( 'automatic-feed-links' );
// This theme styles the visual editor with editor-style.css to match the theme style.
add_editor_style();
// This theme allows users to set a custom background
add_custom_background();
// This theme uses post thumbnails
add_theme_support( 'post-thumbnails' );
add_image_size( 'extra-featured-image', 620, 200, true );
function zbench_featured_content($content) {
if (is_home() || is_archive()) {
the_post_thumbnail( 'extra-featured-image' );
}
return $content;
}
add_filter( 'the_content', 'zbench_featured_content',1 );
function zbench_post_image_html( $html, $post_id, $post_image_id ) {
$html = '<a href="' . get_permalink( $post_id ) . '" title="' . esc_attr( get_post_field( 'post_title', $post_id ) ) . '">' . $html . '</a>';
return $html;
}
add_filter( 'post_thumbnail_html', 'zbench_post_image_html', 10, 3 );
// Your changeable header business starts here
define( 'HEADER_TEXTCOLOR', '' );
// No CSS, just IMG call. The %s is a placeholder for the theme template directory URI.
define( 'HEADER_IMAGE', '' ); // default: none IMG
// The height and width of your custom header. You can hook into the theme's own filters to change these values.
// Add a filter to zbench_header_image_width and zbench_header_image_height to change these values.
define( 'HEADER_IMAGE_WIDTH', apply_filters( 'zbench_header_image_width', 950 ) );
define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'zbench_header_image_height', 180 ) );
// We'll be using post thumbnails for custom header images on posts and pages.
// We want them to be 950 pixels wide by 180 pixels tall.
// Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php.
set_post_thumbnail_size( HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true );
// Don't support text inside the header image.
define( 'NO_HEADER_TEXT', true );
// Add a way for the custom header to be styled in the admin panel that controls
// custom headers. See zbench_admin_header_style(), below.
add_custom_image_header( '', 'zbench_admin_header_style' );
if ( ! function_exists( 'zbench_admin_header_style' ) ) {
//Styles the header image displayed on the Appearance > Header admin panel.
function zbench_admin_header_style() {
?>
<style type="text/css">
/* Shows the same border as on front end */
#headimg { }
/* If NO_HEADER_TEXT is false, you would style the text with these selectors:
#headimg #name { }
#headimg #desc { }
*/
</style>
<?php
}
}
} // end of zbench_setup()
endif;
//////// Load up our theme options page and related code.
require( dirname( __FILE__ ) . '/library/theme-options.php' );
//////// Load custom theme options
$zbench_options = get_option('zBench_options');
zrobiłem coś takiego że w linijce 54, to jest $GLOBALS['comment'] = $comment; zmieniłem ten kod na wp_add_filter();
następnie nazwę katalogu zbench zmieniłem na zbench 2
i efekt jest taki, że po wpisaniu adrsu wyświetla mi się tylko panel administracyjny, ale teraz problem jest taki że strona główna bloga jest kompletnie pusta,
i mam zainstalowany w wyglądzoie zupełnie inny motyw
i nie wiem co dalej robić
Liczba postów: 393
Liczba wątków: 0
Dołączył: 04-06-2010
Reputacja:
15
25-03-2012, 23:19
(Ten post był ostatnio modyfikowany: 25-03-2012, 23:24 przez Engine.)
w tym co podałeś tu masz błąd (niepotrzebny apostrof)
Kod PHP: function iworks_only_one_category() { if ( is_home() || is_front_page() ) { global $wp_query; $wp_query->query(cat="10"); } }
---
nazwę zmieniłeś na zbench 2 czy zbench2 - nazwie nie może być spacji
|
Podobne wątki… |
Wątek: |
Autor |
Odpowiedzi: |
Wyświetleń: |
Ostatni post |
|
Jak zrobć POP-UP w html/php i proste pytanko html? |
MrOMGWTF |
7 |
5,569 |
01-05-2021, 10:56
Ostatni post: wozniak
|
|
Strona HTML na zaliczenie - dodaj, usuń, edytuj |
Kurana |
1 |
2,092 |
01-07-2019, 03:31
Ostatni post: mpire
|
|
[HTML] Filmik zamiast obrazka wyróżniającego |
kuklaale |
1 |
2,759 |
02-11-2016, 18:36
Ostatni post: martt4dg
|
|
Problem zm osadzeniem skryptu lighbox w kodzie html |
gajowy873 |
2 |
3,712 |
24-09-2016, 02:22
Ostatni post: Anatol64
|
|
[CSS][HTML] Ustawienie obrazka z boku strony |
Witek7777 |
8 |
8,477 |
22-09-2016, 01:05
Ostatni post: pocahontas
|
Użytkownicy przeglądający ten wątek: 1 gości
|
|
Sponsorzy i przyjaciele
|
|
|