WordPress.org

Ready to get started?Download WordPress

Forums

How to have 3 loops on my theme (6 posts)

  1. GeorgeOz
    Member
    Posted 3 years ago #

    Hi there,

    I am in the middle of creating a new WordPress theme for my new project and I am not sure how to add 3 loops into the index.php.

    Here is how it will be...

    Home Page:
    Loop 1
    - Featured post, 1 Post (from Featured Category only)

    Loop 2
    - Latest Posts, 4 Posts (All remaining posts except Featured and Resources cat)

    Loop 3
    - Latest Resources, 4 Posts (from Resources Category only)

    I hope this makes sense, I don't want any duplicates going into each.

    If someone can help me would be much appreciated.

    Many thanks.

    George

  2. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

  3. GeorgeOz
    Member
    Posted 3 years ago #

    I've looked through that and it seems it is for a 2 loop script. I'm not too clued up on PHP so wouldn't know where to start on a 3 loop? lol

    Sorry

  4. GeorgeOz
    Member
    Posted 3 years ago #

    Can anyone help or point me in the right direction of incorporating a 3 loop system on my wordpress install?

    Thanks.#
    George

  5. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    you simply add a third loop after the two others.

    example: http://wordpress.pastebin.com/kSWUbKSt

    (totally untested, no formatting)

    http://codex.wordpress.org/Function_Reference/get_cat_ID

  6. GeorgeOz
    Member
    Posted 3 years ago #

    Wicked, I will try that many thanks.

    This is what I had... http://pastebin.com/NT6eNHfk

Topic Closed

This topic has been closed to new replies.

About this Topic