Support » Fixing WordPress » Multiple Loop homepage trouble

  • Resolved ChapDaddy65

    (@chapdaddy65)


    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?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Michael

    (@alchymyth)

    Forum Moderator

    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

    ChapDaddy65

    (@chapdaddy65)

    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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Multiple Loop homepage trouble’ is closed to new replies.