Support

Account

Home Forums General Issues Taxonomy Issue Reply To: Taxonomy Issue

  • tried the below instead.. it displays the category information, but below the post (see the screenshot) which makes no sense, as it should be displaying it where it says Belgium, and then when you press the expander it will display the posts (the MEPs) underneath.

    <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' => $parentcat,
                    'field' => 'slug',
                    'terms' => array( $member_group_term->slug ),
                    'operator' => 'IN',
                )
            )
        )
    	);
        ?>
            <div class="panel-heading">
    		<div class="col-md-2"><?php echo $member_group_term->category_image; ?></div>
    			<div class="col-md-10"><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>
    <?php
    endwhile;
    endif;
    ?>
    <?php
        // Reset things, for good measure
        $member_group_query = null;
        wp_reset_postdata();
    }
    ?>
    <!-- END SUB CATEGORY POSTS AREA -->
            </div>
    
        </div>
    </div>

    Any help to fix this would be awesome!