2011-01-06 141 views

回答

7

你能更具体一点吗?以下是如何让你的主题widget准备就绪:

的functions.php

// register sidebars 
if (function_exists('register_sidebar')) 
    if (function_exists('register_sidebar')) 
     register_sidebar(array('name'=>'Left Sidebar', //Name your sidebar 
     'description' => 'These widgets will appear in the left sidebar.', 
     'before_widget' => '<div class="widget">', // Displays before widget 
     'after_widget' => '</div>', // Displayed after widget 
     'before_title' => '<h3>', //Displays before title, after widget start 
     'after_title' => '</h3>' //Displays after title 
    )); 

然后把这个地方你的侧边栏会出现:

<?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('Sidebar Name Here')) : ?> 
    <!-- static content goes here if sidebar is inactive --> 
<?php endif; ?> 
+0

+1,伟大的回答,你好@Jared,我们如何才能在页面中获取dynamic_sidebar()的标题? – SagarPPanchal 2014-07-25 06:31:22

相关问题