2010-08-30 59 views
0

我很难为我的Wordpress主题设置第二个侧边栏。添加第二个Wordpress部件

下面是function.php代码:

<?php 
if(function_exists('register_sidebar')){ 
    register_sidebar(array(
     'before_widget'=>'<li>', 
     'after_widget'=>'</li>', 
     'before_title'=>'<h2>', 
     'after_title'=>'</h2>', 
    )) 
; 
} 
?> 
<?php 
if(function_exists('register_sidebar')){ 
    register_sidebar('home'array(
     'before_widget'=>'<li>', 
     'after_widget'=>'</li>', 
     'before_title'=>'<h2>', 
     'after_title'=>'</h2>', 
    )) 
; 
} 
?> 

这是当我尝试访问控件选项页中管理我收到的错误:

Parse error: syntax error, unexpected T_ARRAY in C:\xampp\htdocs\tlc\wp-content\themes\tlc\functions.php on line 14

+0

有一个蠕虫堆栈交换网站,你应该看看。 – Sruly 2010-08-30 18:25:27

回答

3

给它一个名使用此语法

register_sidebar(array(
    'name' => 'RightSideBar', 
    'description' => 'Widgets in this area will be shown on the right-hand side.', 
    'before_title' => '<h1>', 
    'after_title' => '</h1>' 
)); 

你写的不是

查看更多信息 http://codex.wordpress.org/Function_Reference/register_sidebar

+0

非常感谢。 – 2010-08-30 18:39:55

相关问题