WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] re-using the query (5 posts)

  1. Beee
    Member
    Posted 2 years ago #

    I want to create a page in the style of Pinterest.
    I want to use 4 columns.
    In column 1 are posts 1, 5, 9, 13 etc
    In columns 2 are posts 2, 6, 10, 14 etc
    In columns 3 are posts 3, 7, 11, 15 etc
    In columns 4 are posts 4, 8, 12, 16 etc

    Instead of querying 1 post each time, I'ld like to re-use the query, but I'm not quite sure how to...

  2. Beee
    Member
    Posted 2 years ago #

    or maybe is it possible doing 4 queries, where each above the posts listed above are queried ?

    Query 1 picks posts 1,5,9,13 from that query, and so on...

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

    rewind_posts() http://codex.wordpress.org/Function_Reference/rewind_posts

    (I posted a similar code in one of my articles a while ago)

  4. Beee
    Member
    Posted 2 years ago #

    I know the rewind_posts should prolly be used, but didn't know how to.
    thanks will look into it...

  5. Beee
    Member
    Posted 2 years ago #

    that did the trick exactly... kudos !

Topic Closed

This topic has been closed to new replies.

About this Topic