Forums

Two loops? (6 posts)

  1. ThorHammer
    Member
    Posted 3 years ago #

    Is it possible to have two separate wp-loops on one blog? This would make it more easy for me to display posts on different locations on my site, posts which does not belong tematic together.

  2. jdh76
    Member
    Posted 2 years ago #

    Not sure exactly what you want to do, but it is certainly possible to have multiple loops on one page. Just do a search for WordPress WP_Query or query_posts and you should find plenty of examples.

    Or if you could elaborate a little more I'll see if I can help.

  3. WordPrezz
    Member
    Posted 2 years ago #

    I don't know what Thor's motivation for two loops is, but here's mine:

    I'd like to set up one loop for "current" posts, and one loop for posts that are past an expiration date set in a custom field of each post.

    I have no idea where to start on setting something like that up.

    Thanks.

  4. Samuel B
    moderator
    Posted 2 years ago #

  5. WordPrezz
    Member
    Posted 2 years ago #

    Thank you, Samboll. The multiple loops setup I understand pretty well. My major issue is that I don't know how to integrate the date from my custom field to dictate what appears in each of those two loops.

  6. WordPrezz
    Member
    Posted 2 years ago #

    To clarify, I want each loop to do the following:

    1st Loop: Display all posts that have not yet passed their expire date.

    2nd Loop: Display all (or a set number of posts) that have passed their expire date.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags