这里有一个奇怪的问题,所以..我已经注册了我的小部件,我可以输入/保存它。但是,当我访问该页面时,文本(或小部件中保存的内容)不显示?
这是我的简单代码,
<?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>',
));
关于我能做什么的任何建议?
答案 0 :(得分:3)
而不是the_widget()
,请使用dynamic_sidebar('facebook-sidebar')
答案 1 :(得分:0)
这样做:
<?php
// Custom widget Area Start
if ( !function_exists('facebook-sidebar') || !facebook-sidebar('Facebook') ) : ?>
<?php endif;
// Custom widget Area End
?>