2013-06-03 32 views
0

在這裏有一個奇怪的問題,所以..我註冊了我的小部件,我可以鍵入/保存它。但是,當我訪問該頁面時,文本(或者小部件內部保存的任何內容)不顯示?WordPress的小部件不顯示

這裏是我的簡單的代碼,

<?php the_widget('facebook-sidebar'); ?> 

register_sidebar(array(

    'name'     => 'Facebook', 

    'id'      => 'facebook-sidebar', 

    'description' => __('Located at the bottom of pages.'), 

    'before_widget' => '<div id="%1$s">', 

    'after_widget' => '</div>', 

    'before_title' => '<h4>', 

    'after_title' => '</h4>', 

)); 

什麼我可以做什麼建議嗎?

回答

3

相反的the_widget(),使用dynamic_sidebar('facebook-sidebar')

+0

哇,感謝這個工作:) – Dexty

0

不喜歡它:

<?php 
// Custom widget Area Start 
if (!function_exists('facebook-sidebar') || !facebook-sidebar('Facebook')) : ?> 
<?php endif; 
// Custom widget Area End 
?> 
相關問題