• Resolved VIPStephan

    (@10010110)


    Let’s say I have three categories with lots of posts in them and I want to load the three latest posts of each category in one WP_Query, what’s the proper way to do this? Is this possible at all?

    • This topic was modified 4 years, 3 months ago by VIPStephan.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    I don’t see how that would be possible with WP_Query. If you can concoct a SQL query to do so, you can execute it through the global $wpdb connection object. I’m no expert in SQL, but I think such a query involves sub-queries, so it may not be any more performant than doing three separate, simpler queries.

    Thread Starter VIPStephan

    (@10010110)

    Thanks, I feared that would be the case. Messing with the database directly is too hot for me, I’m going to live with the limitation, I guess.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Load specific number of posts of each category with one loop’ is closed to new replies.