WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. creativecheetah
    Member
    Posted 4 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:

    http://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.

  2. miocene22
    Member
    Posted 4 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
    Member
    Posted 4 years ago #

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

    http://wordpress.pastebin.ca

  4. creativecheetah
    Member
    Posted 4 years ago #

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

    http://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.

  5. MichaelH
    Member
    Posted 4 years ago #

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

  6. creativecheetah
    Member
    Posted 4 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