dynamic_sidebar()调用并显示自定义sidebar侧边栏

目录

描述

This function calls each of the active widget callbacks in order, which prints the markup for the sidebar. If you have more than one sidebar, you should give this function the name or number of the sidebar you want to print. This function returns true on success and false on failure.

The return value should be used to determine whether to display a static sidebar. This ensures that your theme will look good even when the Widgets plug-in is not active.

If your sidebars were registered by number, they should be retrieved by number. If they had names when you registered them, use their names to retrieve them.

dynamic_sidebar() 描述

用法

 <?php dynamic_sidebar$index ); ?> 

dynamic_sidebar() 用法

参数

index

(integer/string) (可选) Name or ID of dynamic sidebar.

默认值: 1

dynamic_sidebar() 参数

示例

Here is the recommended use of this function:

in the "Twenty Ten" theme (3.0+)

dynamic_sidebar() 示例

源文件

dynamic_sidebar() 函数的代码位于 wp-includes/widgets.php.

dynamic_sidebar() 源文件

相关