Filter Custom Taxonomy Posts

I have a custom taxonomy page, it also has a slider up top. The problem is the slider displays random posts from all taxonomies rather than the current taxonomy. Is there a way to filter the images in the slider so it would only use the current taxonomy?

global $taxonomy_location_url, $taxonomy_profile_url;
$args = array(
‘post_type’ => $taxonomy_profile_url,
‘orderby’ => ‘rand’,
‘meta_query’ => array( array(‘key’ => ‘featured’, ‘value’ => ‘1’, ‘compare’ => ‘=’, ‘type’ => ‘NUMERIC’) ),
‘posts_per_page’ => get_option(“slideritems”)
$q = query_posts($args);

if ( have_posts()) :

while ( have_posts() ) : the_post();
$category = wp_get_post_terms(get_the_ID(), $taxonomy_location_url);
$linktitle = get_the_title();
$imagealt = get_the_title();


Read more here:: Filter Custom Taxonomy Posts

Leave a Reply

Your email address will not be published. Required fields are marked *