0
我想将边栏上的广告,但按钮区会出现在WP-管理面板(外观>窗口小部件)WordPress的侧栏区域没有出现
然而,当我把我的广告在边栏小部件区域,它不会出现在网站上。
我使用下面的代码来创建小部件区域并将其放置在我的主题的fuctions.php文件中。我哪里错了?
if (function_exists('register_sidebar')) {
register_sidebar(array(
'name' => 'Sidebar Widgets',
'id' => 'sidebar-widgets',
'description' => 'Widget Area',
'before_widget' => '<div id="one" class="two">',
'after_widget' => '</div>',
'before_title' => '<h2>',
'after_title' => '</h2>'
));
}
我将不胜感激。
以下是我的页面模板。
<?php
/**
The template for displaying all pages.
*/
get_header();
?>
<div id="main" class="<?php echo $solid_content_class; ?> clearfix" role="main">
<?php
do_action('solid_before_content');
while (have_posts()) : the_post();
get_template_part('lib/content/content', 'page');
endwhile; // end of the loop.
do_action('solid_after_content');
// If the theme supports comments in pages and comments are open or we have at least
one comment, load up the comment template
if(solid_theme_supports('comments', 'pages') && (comments_open() || '0' !=
get_comments_number()) ) comments_template('', true);
?>
</div><!-- #main -->
<?php if($solid_sidebar_location === 'left' || $solid_sidebar_location === 'right')
{ ?>
<aside id="sidebar" class="sidebar <?php echo $solid_sidebar_class; ?>">
<div id="sidebar-main" class="sidebar">
<?php get_sidebar(); ?>
</div><!--sidebar-main-->
</aside>
<?php }
get_footer(); ?>'
调用等dynamic_sidebar在页边栏( '侧边栏插件'); – 2014-12-04 07:42:01
你的页面模板是什么样的?你确定你在调用侧边栏吗? – rnevius 2014-12-04 07:43:05
@mevius,谢谢你的评论。请检查我上面添加的页面模板。 – JMWalker 2014-12-04 09:47:57