• Hi! I recently was lucky enough to find a great help on this forum dealing with multiples loops, thanks to alchymyth, but now I’m stuck again.

    Starting from this code, I’m showing sticky posts in the first loop. But now I try to show the second last post from 3 specific categories (the latest posts from these categories are shown in the second loop).

    Example:

      Second last post for the Games category
      Second last post for the Books category
      Second last post for the Movies category

    I tried to modify the code of the first loop but it doesn’t work. Here is what I tried:

    $my_query = new WP_Query(array('posts_per_page' => 1, 'category__in' => 4,5,6, 'post__not_in' => array_merge($do_not_duplicate, get_option( 'sticky_posts' )) ) );

    Coding shouldn’t not be so difficult! 😉

    I’m still trying things out but if you think you can be of any help, that would be very nice of you! Thanks!

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Show second last post from 3 categories’ is closed to new replies.