Support

Account

Home Forums General Issues Taxonomy Issue Reply To: Taxonomy Issue

  • that sooooo close!

    Its still showing the parent category at the top, which is wrong… but its now showing the child category below, which is right.

    <div id="accordion" class="panel-group">
        <div class="panel panel-default">
    <!-- SUB CATEGORY TITLE AREA -->
    <?php $member_group_terms = get_terms( 'meps_category' ); ?>
    <?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',
    				'parent' => $currentCat,
                    'field' => 'slug',
                    'terms' => array( $member_group_term->slug ),
                    'operator' => 'IN',
                )
            )
        )
    	);
        ?>
            <div class="panel-heading">
    		<!--<div class="col-md-2"><img src="#" /></div>-->
    			<div class="col-md-12"><h3><?php echo $member_group_term->name; ?></h3>
    			<p><?php echo $member_group_term->description; ?></p></div>
    			<div class="clear bottomgap"></div>
    			<div class="col-md-8"></div><div class="col-md-4"><a data-toggle="collapse" data-parent="#accordion" class="button" href="#<?php the_ID(); ?>">View MEPs</a> <a href="#" class="button" target="_blank">Visit Website</a></div>
            <div class="clear"></div>
    		</div>
    <div class="clear"></div>
    <?php  if ( $member_group_query->have_posts() ) : ?>
    <!-- END SUB CATEGORY TITLE AREA -->
            <div id="<?php the_ID(); ?>" class="panel-collapse collapse col-md-12">
    <!-- SUB CATEGORY POSTS AREA -->
    		<?php while ( $member_group_query->have_posts() ) : $member_group_query->the_post(); ?>
                <div class="panel-body">
    			<div class="col-md-2 meppic"><?php the_post_thumbnail(); ?></div>
    			<div class="col-md-10"><h3 class="mepname"><?php echo the_title();?></h3>
    			<strong><?php the_field('title_position'); ?></strong>
    			<div class="clear"></div>
    			<?php the_field('location'); ?>
    			<div class="clear"></div>
    			<br/>
                <?php the_field('description'); ?>
    			<div class="clear"></div>
    			<br/>
    			<div class="col-md-3 first"><strong>Email:</strong> <a href="mailto:<?php the_field('email'); ?>"><?php the_field('email'); ?></a></div><div class="col-md-3"><strong>Website:</strong> <a href="<?php the_field('website'); ?>" target="_blank"><?php the_field('website'); ?></a></div><div class="col-md-3"><strong>Tel:</strong> <?php the_field('tel'); ?></div><div class="col-md-3 last"><a href="http://www.twitter.com/<?php the_field('twitter_id'); ?>" target="_blank"><?php the_field('twitter_id'); ?></a></div>
    			</div>
    			</div>
    <!-- END SUB CATEGORY POSTS AREA -->
            </div>
    		<?php
    endwhile;
    ?>
    <?php endif; ?>
    <?php
        // Reset things, for good measure
    	$member_group_query = null;
        wp_reset_postdata();
    }
    ?>
        </div>
    </div>