I've been researching this, but there are so many choices I'm confused.

What I would like to do is display two loops on a static page that:

  1. the first loop displays all posts with the tag "featured"
  2. the first loop displays the thumbnail as well
  3. the second loop displays all other posts, excluding the ones already featured

There seems to be many options, some wrong, some seemingly too complicated.

Is there a best practice for doing this?


1 Answer 1

  1. Query first set of posts (probably with get_posts(), unless you feel up to using WP_Query directly).

  2. Loop through it, display, save their IDs in some variable.

  3. Loop through them again, display thumbnails.

  4. Query second set of posts, excluding IDs saved earlier via post__not_in.

  5. Loop through it and display.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.