Get URL for specific post type and current tag

If the URL to the ‘cancer’ taxonomy term in your example looked like this: yourwebsite.com/topics/cancer/ then you could filter these results by post type with a URLs structured like this: yourwebsite.com/topics/cancer/?post_type=question Just put this in functions.php add_filter( ‘pre_get_posts’, ‘wp123_post_type_by_taxonomy’ ); function wp123_post_type_by_taxonomy( $query ) { if( is_tax( ‘topics’ ) && $query->is_main_query() ) { // get … Read more

Custom Taxonomy and tax_query Issue?

I think that the problem is right in your code, but it’s really easy to overlook. Let’s take a closer look at this part: <div class=”col-md-4″> <?php echo $category_name = $get_categories[$i]->name; ?> </div> <?php $args = array( ‘post_type’ => ‘team’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘Team_Category’, ‘field’ => ‘slug’, ‘terms’ => $category_name ) ) … Read more