Title: [Plugin: Events Calendar] Filtering by Parent Categories
Last modified: August 31, 2016

---

# [Plugin: Events Calendar] Filtering by Parent Categories

 *  [fghtffyrdmns](https://wordpress.org/support/users/fghtffyrdmns/)
 * (@fghtffyrdmns)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/plugin-events-calendar-10/)
 * I have a some categories set up like so:
 * **Age**
    Child Teen Adult **Language** English Spanish French Where Age and Language
   are parent categories, and those following are child categories.
 * Relevant code below:
 *     ```
       $cat = (isset($_GET['cat'])) ? $_GET['cat'] : 0;
       $args = array(
                   'tax_query' => array(
                       array(
                           'taxonomy' => 'tribe_events_cat',
                           'field' => 'id',
                           'terms' => $cat,
                       ),
   
                   )
           );
           $my_query = new WP_Query($args);
       ```
   
 * Right if I choose Child and Teen it will display all posts tagged with Child 
   OR Teen, which is desired. But if I also choose Spanish, it will display events
   tagged with Child OR Teen OR Spanish.
 * How can I fix my query so that if I choose Child and Spanish, it will pull posts
   tagged with Child AND Spanish instead of posts tagged with Child OR Spanish?

The topic ‘[Plugin: Events Calendar] Filtering by Parent Categories’ is closed to
new replies.

## Tags

 * [custom-query](https://wordpress.org/support/topic-tag/custom-query/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [wp_query](https://wordpress.org/support/topic-tag/wp_query/)

 * 0 replies
 * 1 participant
 * Last reply from: [fghtffyrdmns](https://wordpress.org/support/users/fghtffyrdmns/)
 * Last activity: [10 years, 2 months ago](https://wordpress.org/support/topic/plugin-events-calendar-10/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
