WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Multiple Loops Not Displaying Properly (8 posts)

  1. sgreve
    Member
    Posted 2 years ago #

    Hey everybody,

    I need to set up the main index on a site to display 3 loops at once, and have each loop display different categories. Only it's not working properly. Here's what I want to happen (quotes around the category slugs):

    Loop 1: Displays latest post from the "episodes" category.
    Loop 2: Displays 2 second-latest posts from "episodes" category.
    Loop 3: Displays 5 most recent posts from "blog" and "sitenews" categories.

    Instead here's what's happening:

    Loop 1: Displays latest post from "sitenews" category.
    Loop 2: Displays 2 copies of latest post from "sitenews" category.
    Loop 3: Displays 5 most recent posts from "blog" and "sitenews" categories.

    For whatever reason the "episodes" category is being totally ignored. Here's the test page: http://chromadile.com/mentalpod/ - And here's a pastebin of my current main index file: http://pastebin.com/184RWrtZ

    Anybody have any ideas?

  2. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

  3. sgreve
    Member
    Posted 2 years ago #

    Yes, that's where I looked up how to have multiple loops.

  4. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    Then there's a flaw in your queries or code. Drop a copy of the file into the WordPress pastebin and post the pastebin url here. Perhaps someone will be able to spot the problem and suggest a solution.

  5. sgreve
    Member
    Posted 2 years ago #

  6. sgreve
    Member
    Posted 2 years ago #

    Someone suggested using wp_reset_query after each loop. Didn't help, but I figured I should share the updated code:

    http://pastebin.com/qe1gtnuC

  7. sgreve
    Member
    Posted 2 years ago #

    New issue! The permalink is right, the thumbnail image is right, but the title and excerpt are being copied from the latest post regardless of category.

    Anybody know what that's about?

    New pastebin: http://pastebin.com/dP5NkQAM

  8. sgreve
    Member
    Posted 2 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.