Support » Fixing WordPress » How do I show posts from multiple categories using WP_Query?

  • Resolved nextlimits

    (@nextlimits)


    Here I’m using one category name to list posts from it. How can I list posts from 2 categories in the same page – what are the arguments for the query ?

    <?php $recentProjects = new WP_Query();
    $recentProjects->query('category_name=proiecte'); ?>
    <?php while ($recentProjects->have_posts()) : recentProjects->the_post(); ?>

    Thank you

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How do I show posts from multiple categories using WP_Query?’ is closed to new replies.