Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

live blog

I've just implemented a new, custom theme. I've noticed that my posts are now displaying all on top of one another and I can't figure out why. To test my code, I swapped out my custom loop for the plain Wordpress loop- the problem persisted. I've also disabled every single plugin and again, problem persists. Any ideas how to fix?

<?php
/*
Template Name: Blog
*/
?>

<?php get_header();?>

<div id="blog-container">
    <div class="content">
    <?php get_sidebar( 'blog');?>
    <?php if(have_posts()) : while(have_posts()) : the_post(''); ?>
        <div class="meta">
            <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></h3>
            <p><span style="font-size:85%"><?php the_tags('tags: ', ', ', '<br />'); ?> | <?php comments_number( 'no responses', 'one response', '% responses' ); ?> comments</span></p>
        </div><!-- end meta -->
        <div class="post">
            <?php the_content('read more...'); ?>
        </div><!-- end post -->
        <div class="share">
            <span class="left-border"></span><!-- end border -->
            <p style="font-family:nevis-webfont;">SHARE THIS POST</p>
            <span class="right-border"></span><!-- end border -->
        </div><!-- end share -->
    </div><!-- end content -->
    <?php endwhile; ?>
    <?php else : ?>
            <p>I'm not sure what you're looking for.</p>
    <?php endif; ?>
</div><!-- end blog-container -->

<?php get_footer();?>
share|improve this question
    
This type of question is too localized for WSPE, it is most likely an error related to javascript or HTML tags. –  Wyck Mar 5 '13 at 4:33
add comment

1 Answer

up vote 1 down vote accepted

You have closed div having content class inside if statement which causes to break nested markup, instead close it outside if statement as following.

<?php
/*
Template Name: Blog
*/
?>
<?php get_header();?>
<div id="blog-container">
<div class="content">
<?php get_sidebar( 'blog');?>
<?php if(have_posts()) : while(have_posts()) : the_post(''); ?>
    <div class="meta">
        <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></h3>
        <p><span style="font-size:85%"><?php the_tags('tags: ', ', ', '<br />'); ?> | <?php comments_number( 'no responses', 'one response', '% responses' ); ?> comments</span></p>
    </div><!-- end meta -->
    <div class="post">
        <?php the_content('read more...'); ?>
    </div><!-- end post -->
    <div class="share">
        <span class="left-border"></span><!-- end border -->
        <p style="font-family:nevis-webfont;">SHARE THIS POST</p>
        <span class="right-border"></span><!-- end border -->
    </div><!-- end share -->

<?php endwhile; ?>
<?php else : ?>
        <p>I'm not sure what you're looking for.</p>
<?php endif; ?>
</div><!-- end content -->
</div><!-- end blog-container -->
<?php get_footer();?>
share|improve this answer
    
I'm afraid it's always the small, simple things that I miss. Thank you for your help. –  user1255049 Mar 5 '13 at 4:56
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.