0

Is there a way to sort post types alternately. So when you query two (or more, but let's take two for example) post types, is there a parameter or method wich you can use to display the results alternatly. so like this

  1. post type 1 (last post from post type 1)
  2. post type 2 (last post from post type 2)
  3. post type 1 (forlast post from post type 1)
  4. post type 2 (forlast post from post type 2)

In de codex I can find nothing about this and it also seems that it is not a very common thing to do, because I can not find anything about it on the internet..

6
  • what do you mean by forlast?? Commented Jan 20, 2014 at 11:53
  • I think it is all about using two Wp_Query's and embedding them in some loop(for or while). Have you tried something like this?
    – sri
    Commented Jan 20, 2014 at 12:03
  • @Maritu Mohanty: I mean the post posted before the last one
    – Maartje
    Commented Jan 20, 2014 at 12:20
  • I thought about it, but have no idea how to do this, because when I make diffrent query's I have to give up diffrent order-by parameters, and i dont know how to loop the forlast post than
    – Maartje
    Commented Jan 20, 2014 at 12:22
  • 1
    possible duplicate of Display posts in random post types
    – s_ha_dum
    Commented Jan 20, 2014 at 14:31

0

Your Answer

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

Browse other questions tagged or ask your own question.