【发布时间】:2011-05-14 02:16:39
【问题描述】:
我正在尝试为我的 Wordpress 主题(Titan - http://wordpress.org/extend/themes/titan)添加另一个侧边栏,但它似乎比教程中使用的主题更高级。
我一直在关注本指南 http://www.blogohblog.com/adding-extra-sidebar-to-your-wordpress-theme/
我的 Functions.php 看起来像这样
<?php
locate_template( array( 'functions' . DIRECTORY_SEPARATOR . 'titan-extend.php' ), true );
我一直在破解的相关块 titan-extend.php 文件看起来像这样
/*---------------------------------------------------------
6. Register Sidebars
------------------------------------------------------------ */
function registerSidebars() {
register_sidebar(array(
'name' => __( 'Sidebar', 'titan' ),
'id' => 'normal_sidebar',
'before_widget' => '<li id="%1$s" class="widget %2$s">',
'after_widget' => '</li>',
'before_title' => '<h2 class="widgettitle">',
'after_title' => '</h2>',
));
register_sidebar(array(
'name' => 'sidebar2'));
'id' => 'sidebar2'
'before_widget' => '<li id="%1$s" class="widget %2$s">',
'after_widget' => '</li>',
'before_title' => '<h2 class="widgettitle">',
'after_title' => '</h2>',
));
}
我得到的当前错误是 致命错误:无法在第 121 行的 /wp-content/themes/titan/functions/titan-extend.php 中重新声明 Titan::registerSidebars()
这就是我所拥有的所有信息,感谢任何和所有帮助
【问题讨论】: