Title: include multiple categories with query_post($args);
Last modified: August 19, 2016

---

# include multiple categories with query_post($args);

 *  [schmacklab](https://wordpress.org/support/users/schmacklab/)
 * (@schmacklab)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/include-multiple-categories-with-query_postargs/)
 * here is my code
 *     ```
       $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
       $args=array(
       'cat' => 3,14,
       'posts_per_page' => 9,
       'paged'=>$paged,);
   
       query_posts($args);
       ```
   
 * I need to pull from category 3 and 14 but this does not work. How can I pull 
   from both categories with this syntax?
 * I am stuck with this code since it’s the only way I’ve gotten custom loops to
   paginate properly.
 * Thanks for your help!

Viewing 1 replies (of 1 total)

 *  [wprelief](https://wordpress.org/support/users/wprelief/)
 * (@wprelief)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/include-multiple-categories-with-query_postargs/#post-1573762)
 * Change that to:
 *     ```
       $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
       $args=array(
       'cat' => array(3,14),
       'posts_per_page' => 9,
       'paged'=>$paged,);
   
       query_posts($args);
       ```
   
 * with “array” and you should see better results.

Viewing 1 replies (of 1 total)

The topic ‘include multiple categories with query_post($args);’ is closed to new
replies.

## Tags

 * [args](https://wordpress.org/support/topic-tag/args/)
 * [query_post](https://wordpress.org/support/topic-tag/query_post/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [wprelief](https://wordpress.org/support/users/wprelief/)
 * Last activity: [15 years, 11 months ago](https://wordpress.org/support/topic/include-multiple-categories-with-query_postargs/#post-1573762)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
