Only My Newest Post is Displaying
-
Hi All,
I’m working on setting up a simple article site using WordPress. Everything is working wonderfully except for the fact that when I try to visit a single post ( /?p=4, for example ), regardless of which post I visit, the content for the newest post is displayed. The <title> is that of the correct post, but the content itself is always the newest post.
The weird thing is this only happens when I switch to my custom theme. However, I simply copied & pasted the code from the Default theme’s single.php and removed the unnecessary bits (I’ve tried without removing anything as well, but to no avail). The code I’m using for single.php:
<?php get_header(); ?><div id="emph">
<h1>Header here</h1>
</div><?php get_sidebar(); ?>
<div id="content">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="post" id="post-<?php the_ID(); ?>">
<h2><a href="<?php echo get_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></a></h2><div class="entrytext">
<?php the_content('<p class="serif">Read the rest of this entry »</p>'); ?>
<?php link_pages('<p><strong>Pages:</strong> ', '</p>', 'number'); ?>
</div>
</div><?php endwhile; else: ?>
<?php endif; ?>
</div>
<?php get_footer(); ?>
Am I going wrong somewhere? Is there something I can fix?
Thanks in advance.
- The topic ‘Only My Newest Post is Displaying’ is closed to new replies.