语法错误,意外的T

我刚刚在我的function.php中添加了一个简报php代码,但粘贴后我得到这个问题:

解析错误:语法错误,第1行/home/a7888901/public_html/wp-content/themes/eleven40/functions.php中的意外T_REQUIRE_ONCE

这是我的function.php代码,请帮我解决它。

<?php
/** Start the engine */require_once( get_template_directory() . '/lib/init.php' );
/** Child theme (do not remove) */define( 'CHILD_THEME_NAME', 'eleven40 theme' );define( 'CHILD_THEME_URL', 'http://www.studiopress.com/themes/eleven40' );/** Add Viewport meta tag for mobile browsers */add_action( 'genesis_meta', 'eleven40_viewport_meta_tag' );function eleven40_viewport_meta_tag() {    echo '<meta name="viewport" content="width=device-width, initial-scale=1.0"/>';}
/** Add new image sizes */add_image_size( 'grid-thumbnail', 270, 100, TRUE );/** Create additional color style options */add_theme_support( 'genesis-style-selector', array(    'eleven40-blue'     => 'Blue',  'eleven40-green'    => 'Green', 'eleven40-red'      => 'Red') );
/** Add support for structural wraps */add_theme_support( 'genesis-structural-wraps', array(    'header',   'nav',  'subnav',   'inner',    'footer-widgets',   'footer') );/** Add the page title section */add_action( 'genesis_before_content_sidebar_wrap', 'eleven40_page_title' );function eleven40_page_title() {   genesis_widget_area( 'page-title', array(       'before' => '<div class="page-title widget-area">',   ) );}
/** Add the after post section */add_action( 'genesis_after_post_content', 'eleven40_after_post' );function eleven40_after_post() { if ( ! is_singular( 'post' ) )  return; genesis_widget_area( 'after-post', array(       'before' => '<div class="after-post widget-area">', ) );}
/** Add 3-column footer widgets */add_theme_support( 'genesis-footer-widgets', 3 );
/** Register widget areas */genesis_register_sidebar( array(    'id'                => 'page-title',    'name'          => __( 'Page Title', 'eleven40' ),  'description'   => __( 'This is the page title section.', 'eleven40' ),) );genesis_register_sidebar( array( 'id'                => 'after-post',    'name'          => __( 'After Post', 'eleven40' ),  'description'   => __( 'This is the after post section.', 'eleven40' ),) );}
/** Add newsletter section on single posts */add_action( 'genesis_after_post_content', 'include_newsletter' );function include_newsletter() {if ( is_singular( 'post' ) )require( CHILD_DIR.'/newsletter.php' );}
/** Customize the entire footer */remove_action( 'genesis_footer', 'genesis_do_footer' );add_action( 'genesis_footer', 'child_do_footer' );function child_do_footer() {    ?><p><center>Copyright &copy; 2013 <a href="http://www.nepaligajalsansar.com/">NepaliGajalSansar</a>.</center></p><?php}

在函数genesis_register_sidebar的第二次调用结束时还有一个额外的} 。 如果您逐行放入1个指令,则可以轻松找到它。

编辑我没有重新发生一切,只是在每个{};之后添加换行符; 由正则表达式。 语法错误位于第37行,在2 /** Register widget areas */

<?php
/** Start the engine */
require_once( get_template_directory() . '/lib/init.php' );

/** Child theme (do not remove) */
define( 'CHILD_THEME_NAME', 'eleven40 theme' );
define( 'CHILD_THEME_URL', 'http://www.studiopress.com/themes/eleven40' );
/** Add Viewport meta tag for mobile browsers */add_action( 'genesis_meta', 'eleven40_viewport_meta_tag' );
function eleven40_viewport_meta_tag() {
    echo '<meta name="viewport" content="width=device-width, initial-scale=1.0"/>';
}

/** Add new image sizes */
add_image_size( 'grid-thumbnail', 270, 100, TRUE );
/** Create additional color style options */add_theme_support( 'genesis-style-selector', array( 'eleven40-blue'     => 'Blue',  'eleven40-green'    => 'Green', 'eleven40-red'      => 'Red') );

/** Add support for structural wraps */
add_theme_support( 'genesis-structural-wraps', array(   'header',   'nav',  'subnav',   'inner',    'footer-widgets',   'footer') );
/** Add the page title section */add_action( 'genesis_before_content_sidebar_wrap', 'eleven40_page_title' );
function eleven40_page_title() {
    genesis_widget_area( 'page-title', array(       'before' => '<div class="page-title widget-area">',   ) );
}

/** Add the after post section */
add_action( 'genesis_after_post_content', 'eleven40_after_post' );
function eleven40_after_post() {
    if ( ! is_singular( 'post' ) )  return;
    genesis_widget_area( 'after-post', array(       'before' => '<div class="after-post widget-area">', ) );
}

/** Add 3-column footer widgets */
add_theme_support( 'genesis-footer-widgets', 3 );

/** Register widget areas */
genesis_register_sidebar( array(    'id'                => 'page-title',    'name'      => __( 'Page Title', 'eleven40' ),  'description'   => __( 'This is the page title section.', 'eleven40' ),) );
genesis_register_sidebar( array(    'id'                => 'after-post',    'name'      => __( 'After Post', 'eleven40' ),  'description'   => __( 'This is the after post section.', 'eleven40' ),) );
}

/** Add newsletter section on single posts */
add_action( 'genesis_after_post_content', 'include_newsletter' );
function include_newsletter() {
    if ( is_singular( 'post' ) )require( CHILD_DIR.'/newsletter.php' );
}

/** Customize the entire footer */
remove_action( 'genesis_footer', 'genesis_do_footer' );
add_action( 'genesis_footer', 'child_do_footer' );
function child_do_footer() {
?><p><center>Copyright &copy;
2013 <a href="http://www.nepaligajalsansar.com/">NepaliGajalSansar</a>.</center></p><?php
}
链接地址: http://www.djcxy.com/p/69443.html

上一篇: syntax error, unexpected T

下一篇: Parse error: syntax error, unexpected T