After about 100 different tries, I got it to work. Not sure if there is a better way, but it works.
$term_slug = get_query_var( 'term' );
$taxonomyName = get_query_var( 'taxonomy' );
$current_term = get_term_by( 'slug', $term_slug, $taxonomyName );
$args = array(
'post_type' => 'clients',
'posts_per_page' => -1,
'orderby' => 'title',
'order' => 'ASC',
'tax_query'=>array(
array(
'taxonomy'=>$taxonomyName,
'field'=>$term_slug,
'terms'=> $current_term,
)
)
);
<?php $query = new WP_Query($args); while ($query->have_posts()) : $query->the_post();?>
//stuff here
<?php endwhile; ?><?php wp_reset_query(); ?>
Related Posts:
- get_terms by custom post type
- Get Posts by Custom Post Type ,Taxonomy, and Term
- How to limit the number of terms (terms acts like categories)
- How do I list custom taxonomy terms without the links?
- wp_insert_term doesn’t work with custom post type’s taxonomy
- show tags of custom post type ONLY
- Count posts that have specific taxonomy term attached
- Retrieve single term slug
- display multiple term post from taxonomy in a single page
- Adding a term name from a custom taxonomy assigned to a post link displayed by a wp_query loop based on another taxonomy
- Get list of terms of current taxonomy archive for another taxonomy
- List all custom post type posts from a given category?
- Get all taxonomies for all post types
- Category page only displaying the posts from a custom type
- Have a Custom Post Type index page display taxonomy items instead of posts
- How to check the terms in single custom post type template
- Custom post taxonomies as tax_query terms?
- Issue on Creating Custom Tax Term Dynamically From Another CPT Meta-box On Publish
- How do I display the taxonomy for a custom post type in an array
- Display latest x posts from all categories in Custom Post Type/Taxonomy
- Conditional statement for if archive page has posts which contain certain taxonomies/categories/tags, show those terms
- Output terms for custom post types
- Custom Taxonomy Terms in Menu lead to which page?
- How to automatically create a terms based on each post of a post type
- Get List of Terms based on a given term (different taxonomy)
- CPT : Next or Previous term link when has not adjacent post
- Order posts by taxonomy terms
- automatically select taxonomy based on post meta
- get taxonomies from terms
- Display Custom Post Type Based on Taxonomy With WP_Query()
- How to order taxonomy terms by most recent post?
- Get all posts for custom taxonomy term
- Pages of my taxonomy terms are showing all posts
- Filter Term By Parent Term – Custom Post Type
- Filter By Term Not Working – Custom Post Type
- Displaying the Taxonomy and a Queried Term on a taxonomy.php page?
- WordPress add taxonomies/terms list as a menu in archive page
- Create an additional template page for every term taxonomy
- Taxonomy Grid Archive Help?
- Custom post type URL returns 404 error page
- List a custom post type’s posts ordered by nested custom taxonomy
- Author template – separate custom post type by custom taxonomy term for $curauth
- get_the_term_list() wanting to loop through the returned values
- List custom taxonomy terms
- Display associated taxonomy child name on single CPT page
- Issue On Listing Woocommerce Parent Tag List
- Taxonomy Archive URL + Template
- Get a custom post type’s taxonomy type term names displayed as checkboxes and filter
- How to list custom taxonomy terms without the hyperlinks?
- How to determ a custom post type url?
- How to display products name in a non-alphabetical order, in a custom field (taxonomy)?
- Taxonomy in URL
- Listing all term items alphabetically / sorting loop
- How to organise this data within WordPress
- Organize WordPress site, so it can maintain with huge database
- Review site custom post type structure
- Filter get_cat_id for Custom Post Type
- Different Category system needed for the Custom Post Type
- Custom Post Type Category Link
- Custom Post type category pages template and loop
- Targeting custom post type
- How to get WordPress term attached to the Post?
- Query posts with double taxonomy
- Linking from CPT page to taxonomy.php
- Page not found for custom post type UI plugin and taxonomy
- return only the first two terms of custom post
- Print current post category during WP_Query
- Adding predefined terms to a taxonomy
- Unable to link categories to custom post type using standard function
- How to Set Taxonomy Object Description?
- Categories and tags for custom post types
- How to add terms (without deleting others)
- Custom select query for taxonomies that have posts categorized in another taxonomy
- Enable taxonomies by post type in an array of CPTs
- How to assign tag to custom post type in wordpress?
- Get parent category id from child category page for custom taxonomy
- Custom Taxonomy Is Being Pulled into a Page, But It Doesn’t Have A Hyperlink
- Querying two taxonomies with tax_query not woking
- Rename a slug label
- Custom Taxonomy Category link
- Get Post Terms of Current Post (selected taxonomy term) – How to get only the taxonomy value and not “Array ( [0] => taxonomy term )” in the frontend?
- How to get all Custom Post Type Filtered by one Specific Taxonomy Term
- Category archive in with conjunction with custom post type is empty
- Hide specific taxonomies from a taxonomy list using ‘get_object_taxonomies’
- How does the ‘the_post_navigation()’ work for CPT’s?
- Add arguments to get_the_terms for custom post types
- How to get only child terms from a custom taxonomy of current post type?
- Custom post type – list posts based on meta_key and display them divided by CPT taxonomy category
- Custom query – get_the_terms not work
- Custom taxonomy (categories) on custom post type return no results
- Filter second dropdown (tax) based on first dropdown (cpt)
- Variable not working in WP_Query
- Hide meta box for everything BUT a certain custom post type
- Archive-posttype.php isn’t loaded
- get_category_link() for custom post type does not include custom slug rewrite?
- How to Display Posts From Category Within a Custom Taxonomy?
- Add tags to custom post type without menu link
- Custom Post Types Archives and Single Pages not showing custom taxonomy data
- Targeting categories in custom fields
- How can I create an automatic drop down menu with my tags?