我的目的是在每页上都有一个左右侧边栏。我已经注册了这两个小部件,实现了我想要的小部件,但有些地方不太对劲。
左侧边栏(sidebar(1)
) 在左侧正确加载,但卡在页面内容下方。右侧边栏(sidebar(2)
) 虽然它在外观>小部件中显示为活动状态,但根本不会显示在页面上。
我忽略了什么?如何才能使两个侧边栏正常显示和运行?谢谢
以下是我所拥有的:
仅有一个的php
<?php get_header(); ?>
<div id="content">
<div id="blog">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<h1 class="title"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h1>
<p class="date">Posted on <?php the_time(\'F j, Y\'); ?> | <?php comments_popup_link(\'No Comments\', \'1 Comment\', \'% Comments\'); ?></p>
<div class="post">
<?php the_content(__(\'Read more\'));?><div style="clear:both;"></div>
<div class="bt-links"><strong>Category:</strong> <?php the_category(\', \') ?><br /><?php the_tags(\'<strong>Tags:</strong> \',\' > \'); ?></div>
</div><!-- end post -->
<!--
<?php trackback_rdf(); ?>
-->
<?php endwhile; else: ?>
<p><?php _e(\'Nothing found here, uh oh!\'); ?></p><?php endif; ?>
</div><!-- end blog -->
</div>
<!-- The main column ends -->
<?php get_sidebar(\'l\'); ?>
<?php get_sidebar(\'r\'); ?>
<?php get_footer(); ?>
提要栏-l.php
<div id="sidebar-left">
<ul class="l_sidebarwidgeted">
<?php if ( function_exists(\'dynamic_sidebar\') && dynamic_sidebar(1) ) : else : ?>
</ul>
</div><!-- end sidebar-left -->
提要栏-r.php
<div id="sidebar-right">
<ul class="l_sidebarwidgeted">
<?php if ( function_exists(\'dynamic_sidebar\') && dynamic_sidebar(2) ) : else : ?>
</ul>
</div><!-- end sidebar-right -->
功能。php
<?php
if ( function_exists(\'register_sidebars\') )
register_sidebars(2);
?>
css
#sidebar {
width: 200px;
}
#sidebar-left {
float: left;
}
#sidebar-right {
float: right;
}
p.sidebar {
font-size: 80%;
}