解析错误:语法错误,意外' =>'第960行(T_DOUBLE_ARROW)

时间:2014-11-13 16:59:30

标签: php html wordpress syntax-error

这是一个Wordpress网站 - 我正在搞乱一些侧边栏的东西,这发生了。顺便说一句,第960行看起来是这样的:

   'id' => 'main-sidebar',

我意识到解析错误告诉我双箭头错误/意外,但我不知道应该在那里做什么。整个块看起来像这样:

if(function_exists('register_sidebar')) {
register_sidebar(array(
    'name' => __('Main Sidebar', ETHEME_DOMAIN),
    'id' => 'main-sidebar',
    'description' => __('The main sidebar area', ETHEME_DOMAIN),
    'before_widget' => '<div id="%1$s" class="sidebar-widget %2$s">',
    'after_widget' => '</div><!-- //sidebar-widget -->',
    'before_title' => '<h4 class="widget-title">',
    'after_title' => '</h4>',

任何帮助将不胜感激。我觉得自己像个白痴。

编辑:这里有更多的代码(这是整个侧边栏区域):

if(function_exists('register_sidebar')) {
register_sidebar(array(
    'name' => __('Main Sidebar', ETHEME_DOMAIN),
    'id' => 'main-sidebar',
    'description' => __('The main sidebar area', ETHEME_DOMAIN),
    'before_widget' => '<div id="%1$s" class="sidebar-widget %2$s">',
    'after_widget' => '</div><!-- //sidebar-widget -->',
    'before_title' => '<h4 class="widget-title">',
    'after_title' => '</h4>',
));
register_sidebar(array(
    'name' => __('Shop Sidebar', ETHEME_DOMAIN),
    'id' => 'shop-sidebar',
    'description' => __('Shop page widget area', ETHEME_DOMAIN),
    'before_widget' => '<div id="%1$s" class="sidebar-widget %2$s">',
    'after_widget' => '</div><!-- //sidebar-widget -->',
    'before_title' => '<h4 class="widget-title">',
    'after_title' => '</h4>',
));
register_sidebar(array(
    'name' => __('Single product page Sidebar', ETHEME_DOMAIN),
    'id' => 'single-sidebar',
    'description' => __('Single product page widget area', ETHEME_DOMAIN),
    'before_widget' => '<div id="%1$s" class="sidebar-widget %2$s">',
    'after_widget' => '</div><!-- //sidebar-widget -->',
    'before_title' => '<h4 class="widget-title">',
    'after_title' => '</h4>',
));
register_sidebar(array(
    'name' => __('Shopping cart sidebar', ETHEME_DOMAIN),
    'id' => 'cart-sidebar',
    'description' => __('Area after cart totals block', ETHEME_DOMAIN),
    'before_widget' => '<div id="%1$s" class="sidebar-widget %2$s">',
    'after_widget' => '</div><!-- //sidebar-widget -->',
    'before_title' => '<h4 class="widget-title">',
    'after_title' => '</h4>',
));
register_sidebar(array(
    'name' => __('Right side panel area', ETHEME_DOMAIN),
    'id' => 'right-panel-sidebar',
    'description' => __('Right side panel widget area', ETHEME_DOMAIN),
    'before_widget' => '<div id="%1$s" class="sidebar-widget %2$s">',
    'after_widget' => '</div><!-- //sidebar-widget -->',
    'before_title' => '<h4 class="widget-title">',
    'after_title' => '</h4>',
));
register_sidebar(array(
    'name' => __('Hidden top panel area', ETHEME_DOMAIN),
    'id' => 'top-panel-sidebar',
    'description' => __('Hidden top panel widget area', ETHEME_DOMAIN),
    'before_widget' => '<div id="%1$s" class="sidebar-widget %2$s">',
    'after_widget' => '</div><!-- //sidebar-widget -->',
    'before_title' => '<h4 class="widget-title">',
    'after_title' => '</h4>',
));
register_sidebar(array(
    'name' => __('Place in header top bar', ETHEME_DOMAIN),
    'id' => 'languages-sidebar',
    'description' => __('Can be used for placing languages switcher of some contacts information.', ETHEME_DOMAIN),
    'before_widget' => '<div id="%1$s" class="%2$s">',
    'after_widget' => '</div><!-- //sidebar-widget -->',
    'before_title' => '<h4 class="widget-title">',
    'after_title' => '</h4>',
));

register_sidebar(array(
    'name' => __('Prefooter Row', ETHEME_DOMAIN),
    'id' => 'prefooter',
    'before_widget' => '<div id="%1$s" class="prefooter-sidebar-widget %2$s">',
    'after_widget' => '</div><!-- //prefooter-sidebar-widget -->',
    'before_title' => '<h4 class="widget-title">',
    'after_title' => '</h4>',
));


register_sidebar(array(
    'name' => __('Footer 1', ETHEME_DOMAIN),
    'id' => 'footer1',
    'before_widget' => '<div id="%1$s" class="footer-sidebar-widget %2$s">',
    'after_widget' => '</div><!-- //footer-sidebar-widget -->',
    'before_title' => '<h4 class="widget-title">',
    'after_title' => '</h4>',
));

register_sidebar(array(
    'name' => __('Footer 2', ETHEME_DOMAIN),
    'id' => 'footer2',
    'before_widget' => '<div id="%1$s" class="footer-sidebar-widget %2$s">',
    'after_widget' => '</div><!-- //sidebar-widget -->',
    'before_title' => '<h4 class="widget-title">',
    'after_title' => '</h4>',
));


register_sidebar(array(
    'name' => __('Footer Copyright', ETHEME_DOMAIN),
    'id' => 'footer9',
    'before_widget' => '<div id="%1$s" class="footer-sidebar-widget %2$s">',
    'after_widget' => '</div><!-- //footer-sidebar-widget -->',
    'before_title' => '<h4 class="widget-title">',
    'after_title' => '</h4>',
));

register_sidebar(array(
    'name' => __('Footer Links', ETHEME_DOMAIN),
    'id' => 'footer10',
    'before_widget' => '<div id="%1$s" class="footer-sidebar-widget %2$s">',
    'after_widget' => '</div><!-- //footer-sidebar-widget -->',
    'before_title' => '<h4 class="widget-title">',
    'after_title' => '</h4>',
));

}

编辑2:这是整个代码文件的行,因为有人要求它:http://pastebin.com/SUnh0Ft8 非常肯定ETHEME_DOMAIN只是php重定向到网站的域名。可能是错的。

1 个答案:

答案 0 :(得分:0)

我从未弄清楚出了什么问题,但我刚刚从之前的PHP文件中备份,一切都很好。看起来我将来会更加谨慎地编辑PHP代码。