Support » Developing with WordPress » WP_Query multiple categories

  • Resolved forevangel23

    (@forevangel23)


    I’ve got this wp_query working, (which is a relief as I’ve had a hard time getting something to work). However, I want to add a secondary category for it to show in this list. How might I add a second?

    $catquery = new WP_Query('cat=12&posts_per_page=6&paged=$paged');

    • This topic was modified 4 years, 2 months ago by forevangel23.
Viewing 1 replies (of 1 total)
  • Thread Starter forevangel23

    (@forevangel23)

    I’ve figured out the solution:

    $catquery = new WP_Query(array('category_name' => 'slug1,slug2', 'post_status' => 'publish', 'posts_per_page' => 6));

Viewing 1 replies (of 1 total)
  • The topic ‘WP_Query multiple categories’ is closed to new replies.