之前的小部件和小部件后的含义

时间:2014-02-04 10:31:23

标签: wordpress

我想知道以下代码中before widgetafter widget的含义:

register_sidebar( array(
        'name'          => __( 'Primary Sidebar', 'twentyfourteen' ),
        'id'            => 'sidebar-1',
        'description'   => __( 'Main sidebar that appears on the left.', 'twentyfourteen' ),
        **'before_widget' => '<aside id="%1$s" class="widget %2$s">',
        'after_widget'  => '</aside>',**
        'before_title'  => '<h1 class="widget-title">',
        'after_title'   => '</h1>',

1 个答案:

答案 0 :(得分:1)

意义:

before_widget - 在每个小部件之前放置的HTML(默认值:'<li id="%1$s" class="widget %2$s">')注意:使用sprintf进行变量替换

after_widget - 放置在每个小部件之后的HTML(默认值:"</li>\n")。

在窗口小部件执行之前的窗口小部件输出位置和窗口小部件执行之后窗口小部件输出位置

了解更多信息Visit this

相关问题