• Resolved creativecheetah

    (@creativecheetah)


    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:

    https://quayside.vpswalkercommunications.co.uk/newsandevents/

    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 />
    			</div>

    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.

Viewing 5 replies - 1 through 5 (of 5 total)
  • 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

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

    https://wordpress.pastebin.ca

    Thread Starter creativecheetah

    (@creativecheetah)

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

    https://wordpress.pastebin.ca/1575256

    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.

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

    Thread Starter creativecheetah

    (@creativecheetah)

    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.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Single page template displaying first post info’ is closed to new replies.