I’ve got an interesting issue with my blog page–
Currently, I have two test posts- “Test Blog Post” and “Test Blog Post Deux.”
Test Blog Post displayed as it should, however when I added the second post(Test Blog Post Deux), the post content seemed to have overwritten the older content.
You can see this in the post- the first paragraph begins with “This is another test blog post. Here’s some more ipsum..” and the second “This is a test blog post. Here’s some ipsum.” without any post title, date, etc. in between.Any ideas what’s going on/how to fix?
Here’s my code:
<div class="blog-meta"> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <h3>posted by ZOPA on <?php the_time('m/d/Y \a\t g:i A') ?> | <?php the_tags('tags: ',' , ','<br />'); ?></h3> </div><!-- end blog-meta --> <div class="blog-post"> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <?php the_content('Read the rest of this entry »'); ?> <?php endwhile; ?> <?php else : ?> //Something that happens when a post isn’t found. <?php endif; ?> </div><!-- end blog-post -->
Answer
the_title()
section is outside the loop which starts with if (have_posts())
consider reviewing:
Attribution
Source : Link , Question Author : user1255049 , Answer Author : amit