• Resolved oh_hello

    (@oh_hello)


    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 &raquo;</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.

Viewing 1 replies (of 1 total)
  • Thread Starter oh_hello

    (@oh_hello)

    I hate to bump this, but I still haven’t been able to fix the problem.

    My custom theme is displaying the newest Post as the content for each individual post. I have simply copied & pasted the code from the Default theme’s single.php, but it will not work for some reason. This has never happened to me before.

    Are there any ideas as to what is going on?

Viewing 1 replies (of 1 total)
  • The topic ‘Only My Newest Post is Displaying’ is closed to new replies.