2011-01-06 104 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

相關問題