WordPress.org

Ready to get started?Download WordPress

Forums

[closed] How do I stop Page Template, Single Post Template from displaying ALL posts? (4 posts)

  1. mortega
    Member
    Posted 4 years ago #

    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):
    http://wordpress.pastebin.ca/1583408

    Page Template (page.php):
    http://wordpress.pastebin.ca/1583413

    Single Post Template (single.php):
    http://wordpress.pastebin.ca/1583415

    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.

  2. MichaelH
    Member
    Posted 4 years ago #

    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.

  3. mortega
    Member
    Posted 4 years ago #

    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?

  4. MichaelH
    Member
    Posted 4 years ago #

    Closing this--continue discussion here:
    http://wordpress.org/support/topic/315739?replies=8

    Also deleted a duplicate topic you started.

Topic Closed

This topic has been closed to new replies.

About this Topic