Live site
在试图让我的侧边栏动态化时,发生了一些事情,导致我的整个侧边栏从博客容器的右侧推到了所有帖子内容的下方。我以前没有遇到过这个问题-我通常可以没有问题-所以我不确定要寻找什么。有什么想法吗?
HTML/PHP
<?php get_header( 'blog');?>
<div id="blog-container">
<div id="blog">
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div class="post-title">
<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
</div><!-- end post-title -->
<div class="post">
<?php the_content('read more..'); ?>
<div class="post-meta">
<p><?php the_date(); ?> | <?php the_tags('tags:', ', ', ''); ?> | <?php comments_number( '0', '1 comment', '% comments' ); ?></p>
<?php comments_template(); ?>
</div><!-- end post-meta -->
<?php endwhile; ?>
<?php else : ?>
Nothing found.
<?php endif;?>
</div><!-- end post -->
</div><!-- end blog -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
</div><!-- end blog-container -->CSS
#sidebar {
float: right;
margin-top: 80px;
padding-right: 10px;
position: relative;
width: 300px;
}
.blog-social {
clear: both;
padding-bottom: 20px;
text-align: center;
}
.blog-social ul li {
display: inline;
padding-right: 10px;
}
.blog-social ul li:last-child {
padding-right: 0px;
}
#sidebar .social-heading {
text-align: center;
}
#sidebar #twitter-feed {
font-family: podkova;
font-size: 80%;
color: #333333;
letter-spacing: 1px;
line-height: 1.5;
padding-top: 20px;
padding-bottom: 20px;
width: 280px;
}
#sidebar #twitter-feed ul li {
padding-bottom: 10px;
}
#sidebar #instagram-feed {
padding-top: 20px;
padding-bottom: 20px;
}发布于 2012-11-10 00:05:30
它看起来像是一个元素缺少结束标记,所以您的侧边栏将呈现在#blog div中。尝试将</div><!-- end post -->移到<?php endwhile; ?>之上。
https://stackoverflow.com/questions/13311388
复制相似问题