Support

Account

Home Forums General Issues Taxonomy Issue Reply To: Taxonomy Issue

  • I’ve tried the below and also tried the ‘parent’ => 0.

    If I do the below, nothing happens. If I do the ‘parent’ => 0 it removes the subcategory and only shows the parent… there must be something i’m doing wrong 🙁

    <?php 
    $member_group_terms = get_terms( 'meps_category', array(
    	'child_of' => 0
     ) );
    ?>
    <?php
    foreach ( $member_group_terms as $member_group_term ) {
        $member_group_query = new WP_Query( array(
            'post_type' => 'mep',
            'tax_query' => array(
                array(
                    'taxonomy' => 'meps_category',
                    'field' => 'slug',
                    'terms' => array( $member_group_term->slug ),
    				'operator' => 'IN' 
                )
            )
        )
    	);?>