syntax error, unexpected T
I have just added a newsletter php code on my function.php but after pasting it I'm getting this problem:
Parse error: syntax error, unexpected T_REQUIRE_ONCE in /home/a7888901/public_html/wp-content/themes/eleven40/functions.php on line 1
Here is my function.php code as it is, please help me to fix it.
<?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 © 2013 <a href="http://www.nepaligajalsansar.com/">NepaliGajalSansar</a>.</center></p><?php}
There is an extra }
at the end of the 2nd call of the function genesis_register_sidebar
. You could found that easily if you put 1 instruction by line.
EDIT I didn't reindent everything but just added newline after each {
, }
and ;
by regex. The syntax error is located next line 37, after the 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 ©
2013 <a href="http://www.nepaligajalsansar.com/">NepaliGajalSansar</a>.</center></p><?php
}
链接地址: http://www.djcxy.com/p/69444.html
上一篇: 语法错误,意外的'
下一篇: 语法错误,意外的T