WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Multiple Loop homepage trouble (3 posts)

  1. ChapDaddy65
    Member
    Posted 1 year ago #

    Link to home.php code.

    Link to wireframevisual aid.

    I want to create (on my homepage) a multiple loop setup. Please refer to my wireframe then continue reading. :)

    --

    Each colored section is a separate post loop grabbing from their own separate category. (i.e. Blue = Blog category | Red = Projects category | Green = Tutorials category)

    The blue and red sections will only show 1 post each and the green section will show 5 posts.

    BUT!

    In the green section, the 1 larger post on the right will be the first post listed and will be the "featured" post from the green section's category. The other 4 posts will be the "latest" posts from the green section's category.

    I am a noob when it comes to custom themeing for WordPress and I tried to give it a shot...and failed.

    So, how can I get this setup properly. What did I do wrong in my home.php?

  2. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    is there a real chance of duplicate posts? because right now, you are not doing anything with the '$do_not_duplicate = $post->ID;'

    there is no 'if( have_posts() )' so the 'endif' is likely to be wrong.

    In the green section, the 1 larger post on the right will be the first post listed and will be the "featured" post from the green section's category.

    how is that 'featured' defined? is that another category?

    you might need a wrapper div for the green section.

    some adaptations, ignoring the green section: http://pastebin.com/90YpFC4S

  3. ChapDaddy65
    Member
    Posted 1 year ago #

    apparently all I needed to do was remove the 'endif'; and it worked...I feel much better.

    @alchymyth: I just copied the code from the codex on Multiple Loops, So I didn't know if the '$do_not_duplicate = $post->ID;' was necessary or not. I am planning on not having any duplicate posts, so I'll just remove that line.

    And yes I have a 'featured' and 'latest' category that I'll use to separate the posts.

Topic Closed

This topic has been closed to new replies.

About this Topic