[resolved] Single page template displaying first post info (6 posts)

  1. creativecheetah
    Posted 6 years ago #

    Hi. I am styling up a site and have it working nicely except for the single post pages. When I click on the post link in the sidebar, each post displays the first post info (header and content). You can see it here:


    So far there are 2 events and 1 news article. But when you click on any of them, they all display the first post data (which is Santa's coming etc). The permalinks appear fine, directing to the right page, but its the post title and content that isn't right. This is the code I have in my single.php file:

    <div <?php post_class() ?> id="post-<?php the_ID(); ?>">
    			<h5><?php the_title(); ?></h5>
                <br />
    			<?php the_content('<p>Read the rest of this entry &raquo;</p>'); ?>
    			<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
    			<?php the_tags( '<p>Tags: ', ', ', '</p>'); ?>
                <br />

    The weird thing is I have used this for another site and it worked grand. I can't honestly think of anything different with this site (uses the same theme template aswell). I must be missing something.

    Any help would be greatly appreciated.

  2. miocene22
    Posted 6 years ago #

    edit: Sorry I originally misunderstood your post.

    In the admin panel is all your post content different?

    Try disabling permalinks and see if it still does it

  3. MichaelH
    Posted 6 years ago #

    Might paste the whole template code (is it single.php) in a pastebin and report the link back here.


  4. creativecheetah
    Posted 6 years ago #

    Hi MichaelH. Here is the template code for single.php


    miocene22: Hey. I'm not 100% sure what you mean.I have made 3 individual posts. I disabled the permalinks so that they had only a page id number and I still get the same thing.

  5. MichaelH
    Posted 6 years ago #

    Guessing your <?php include (TEMPLATEPATH . '/newsevents_sidebar.php'); ?> is causing the problem. Might add wp_reset_query(); after that line.

  6. creativecheetah
    Posted 6 years ago #

    MichaelH thanks very much! Works perfectly. It now occurs to me that the code for the main news page and single post pages is the same. The reset works perfectly. Again, thanks.

    Cheers miocene22 for your input.

Topic Closed

This topic has been closed to new replies.

About this Topic