I need posts within a taxonomy category that are tagged “featured” to show up first
https://yoga.gcclients.com/listing-category/bucks-county/
Right now it’s pulling posts from ALL posts within the business listing taxonomy tagged “featured” instead of ones from the category of the page the user is looking at
so if in on bucks county page - it should pull posts that are tagged “featured” and are in the bucks county category only
Or if they view another category for instance - New Jersey - https://yoga.gcclients.com/listing-category/new-jersey/ it should pull posts tagged “featured” that are in the New Jersey category only
Here is the code we are currently using:
<!-- /* START FEATURED BUSINESSES */ -->
<ul class="archive-businesses">
<?php
$args = array( 'post_type' => 'businesslistings', 'posts_per_page' => 6, 'orderby' => rand, 'tag' => 'featured' );
$the_query = new WP_Query( $args );
?>
<?php if ( $the_query->have_posts() ) : ?>
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<li class="archive-bizlist">
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( array(300,300) ); ?></a>
<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
<div id="archive-bizlisting-address">
<?php if(get_post_meta($post->ID, 'biz_street_address', true)): ?>
<i><?php echo get_post_meta($post->ID, 'biz_street_address', true); ?></i><br />
<?php endif; ?>
<?php if(get_post_meta($post->ID, 'biz_city', true)): ?>
<i><?php echo get_post_meta($post->ID, 'biz_city', true); ?>,</i>
<?php endif; ?>
<?php if(get_post_meta($post->ID, 'biz_state', true)): ?>
<i><?php echo get_post_meta($post->ID, 'biz_state', true); ?></i>
<?php endif; ?>
<?php if(get_post_meta($post->ID, 'biz_zip_code', true)): ?>
<i><?php echo get_post_meta($post->ID, 'biz_zip_code', true); ?></i>
<?php endif; ?>
</div>
<?php the_excerpt(); ?>
</li>
<?php endwhile;?>
</ul>
<?php endif; ?>
<!-- /* END FEATURED BUSINESSES */ -->