Support » Themes and Templates » How do I stop Page Template, Single Post Template from displaying ALL posts?

  • I’ve created themes before and NEVER ran into a problem that’s given me such a pain in the ass like this.

    I created a theme for a microsite ran on the latest version of WordPress, however, when I go to a page or a single post URL, it displays ALL the posts. I thought it might be a 404 page reverting to my index file but my index file has a different sidebar so I know that cannot be the case. I’ve also thrown random text into both templates (page.php and single.php) and they show up at the top of my pages and individual posts, respectively, but the content below is just all the posts I have written for both.

    It has to be a problem with the loop, which it seems WordPress has made even more PHP’y and I don’t understand nearly as much. I’ve looked at other WordPress themes that output the right content and I don’t see any major differences, really.

    I called the comments.php file with code and/or sample text and it never shows up.

    I am calling a custom header and a custom sidebar (another way I know it isn’t producing a 404 page).

    Main Index Template (index.php):

    Page Template (page.php):

    Single Post Template (single.php):

    I am at a total loss for what to do. I’ve looked through a dozen other themes that I have used in the past and I cannot see any structural difference that these files do not have.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Going to guess that sidebar2 or header2 has some kind of query code that is wrecking your posts object..if so put a wp_reset_query() after that query.

    Is that a new tag? I’ve never seen that tag before and I’ve worked with WordPress for almost 5 years now.

    I tried it, did nothing.

    I am trying to get the content to stop repeating with <?php get_header(); ?> and <?php get_sidebar(); ?> call functions in, so the sidebar2 and header2 cannot be the problem.

    It’s gotta be something with the loop, no?

    Closing this–continue discussion here:

    Also deleted a duplicate topic you started.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How do I stop Page Template, Single Post Template from displaying ALL posts?’ is closed to new replies.