php 注册一个新的侧边栏

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php 注册一个新的侧边栏相关的知识,希望对你有一定的参考价值。

add_action( 'widgets_init', 'my_awesome_sidebar' );
function my_awesome_sidebar() {
$args = array(
'name' => 'Awesome Sidebar',
'id' => 'awesome-sidebar',
'description' => 'The Awesome Sidebar is shown on the left hand side of blog pages in this theme',
'class' => '',
'before_widget' => '<li id="%1$s" class="widget %2$s">',
'after_widget' => '</li>',
'before_title' => '<h2 class="widgettitle">',
'after_title' => '</h2>' 
);

以上是关于php 注册一个新的侧边栏的主要内容,如果未能解决你的问题,请参考以下文章