!
也想出现在这里? 联系我们
内容广告块

register_sidebar()函数-WP常用函数

释放双眼,带上耳机,听听看~!

register_sidebar()函数注册一个单独的侧边栏区域和返回ID

<?php register_sidebar( 
    array(
        'name'          => '侧边栏',
        'id'            => 'unique-sidebar-id',
        'description'   => '',
        'class'         => '',
        'before_widget' => '<div class="s-con text-center">',
        'after_widget'  => '</div>',
        'before_title'  => '<h2 class="widgettitle">',
        'after_title'   => '</h2>' 
    )
); ?>

参数

name – 侧边栏的名字(默认是 ‘Sidebar’ 加 数字 ID)
id – 侧边栏 ID,必须全部小写,不带空格(默认是一个自动递增的数字 ID)
description – 用来说明侧边栏是什么,在哪里显示的文字。会在小工具管理界面显示。(默认为空)
class – 分配到小工具 HTML输出中的CSS选择器名字(默认为空)
before_widget – 在每个小工具前面输出的 HTML代码(默认: ‘<li id=”%1$s” class=”widget %2$s”>’)
after_widget – 在每个小工具后面输出的 HTML代码(默认: “</li>”)
before_title – 在标题前输出的 HTML代码(默认: <h2 class=”widgettitle”>)
after_title – 在标题后输出的 HTML代码(默认:”</h2>”)

给TA打赏
共{{data.count}}人
人已打赏
PHP学习日记

add_options_page()函数-WP常用函数

2020-12-13 12:47:23

PHP学习日记

dynamic_sidebar()函数和is_dynamic_sidebar()函数-WP常用函数

2020-12-14 7:34:00

版权声明 本站所发布的一切与破解相关的文章仅限用于学习和研究目的,请在下载后的24个小时之内,从您的电脑中彻底删除。所有资源均来自于网络,不得用于商业或者非法用途,否则一切后果请用户自负。如有问题请及时与我联系,QQ:526733428,或提交工单。
0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
购物车
优惠劵
今日签到
有新私信 私信列表
搜索

Warning: error_log(/www/wwwroot/zyansong.com/wp-content/plugins/spider-analyser/#log/log-0319.txt): failed to open stream: No such file or directory in /www/wwwroot/zyansong.com/wp-content/plugins/spider-analyser/spider.class.php on line 2900