Title: parse_query on category page
Last modified: August 21, 2016

---

# parse_query on category page

 *  Resolved [somtam](https://wordpress.org/support/users/somtam/)
 * (@somtam)
 * [11 years, 12 months ago](https://wordpress.org/support/topic/parse_query-on-category-page/)
 * Hi everybody,
 * I am triggering the parse_query action to change the default query on category
   page.
    The problem is that I would like to make a different post_status for the
   post and the attachment.
 * Null for attachment,
    Public or private for post.
 *     ```
       function ab_add_posts_attachments_to_category_query() {
          global $wp_query;
          if ( is_category() ) {
             $wp_query->query_vars['post_type'] =  array( 'post', 'attachment' );
             $wp_query->query_vars['post_status'] =  array( null );
             return $wp_query;
          }
       }
       add_action('parse_query', 'ab_add_posts_attachments_to_category_query');
       ```
   
 * as you see in my code the post_status is NULL for everything!
    thanks!

Viewing 1 replies (of 1 total)

 *  Thread Starter [somtam](https://wordpress.org/support/users/somtam/)
 * (@somtam)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/parse_query-on-category-page/#post-4942929)
 * Solved,
 * is enough to set:
    $wp_query->query_vars[‘post_status’] = array( ‘publish’, ‘
   inherit’, ‘private’ );
 * thanks!

Viewing 1 replies (of 1 total)

The topic ‘parse_query on category page’ is closed to new replies.

## Tags

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

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 1 reply
 * 1 participant
 * Last reply from: [somtam](https://wordpress.org/support/users/somtam/)
 * Last activity: [11 years, 11 months ago](https://wordpress.org/support/topic/parse_query-on-category-page/#post-4942929)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
