As you point out, if you want separate loops for different post types you’ll need to use a separate WP_Query()
for post type. In the template you can get the current term (ID) being viewed via: get_queried_object_id()
(see source)
$args = array(
'post_type' => 'staff',
'tax_query' => array(
array(
'taxonomy' => 'themes',
'terms' => get_queried_object_id(),
'field' => 'id'
)
),
);
$staff = WP_Query( $args );
Related Posts:
- Filtering a custom post type by custom taxonomy in archive template
- Permalink Structure for Multiple Post Type Archives by Taxonomy
- get term archive url / link
- Pagination throws 404 error on custom taxonomy archive pages
- Archive page with multiple taxonomies rewrite
- Create permalink structure for one taxonomy archive per custom post type
- Pages, Custom Posts & Custom Taxonomy defining slug structure
- How to show a tag archive of one post type only
- Custom taxonomy archive page not working
- Disable single pages and archives and keep preview
- How to create archive page for taxonomy terms within custom post type
- Category and post tag archives do not include posts from custom post type
- Get post type from taxonomy or category page
- custom taxonomy archive by year
- Display custom post type taxonomies as an archive page
- Archive page for taxonomy terms
- Custom Post Type Archive Page Filtering
- Root slug of taxonomy returning 404
- Create template for taxonomy results limited by Custom Post Type
- How do I check if the user is on a taxonomy term parent, child or grandchild page?
- Custom post type / taxonomy rewrite archive page 2 gives 404
- How can I get this request to use the Custom Post Type page template instead?
- Archive for a Taxonomy of a Custom Post type
- What’s the name of the custom post type yearly archive template?
- Custom Post type & Taxonomy 404
- Taxonomy archive 404ing (not term archive)
- Custom taxonomy or custom page templates?
- Dynamically insert an article at the top of a taxonomy archive – or?
- Only show posts with a specific term of an associated taxonomy in a custom post type archive
- Use the custom post type archive for taxonomies?
- How to rewrite custom taxonomy term archive to use THE SAME SLUG/front as CPT
- Get the link of the first post of a custom taxonomy in a custom taxonomy list
- Archive page for custom post type and custom taxonomy
- Advanced archive url structure (category, tag and date)
- How can I tell if I’m on a custom post type archive page?
- Custom Post Type Archive Page showing as 404
- Set up Custom Taxonomy Archive Template File To Cover 3 Categories
- How to show custom post count in archive page
- Order archive custom posts by taxonomy term [duplicate]
- Custom category taxonomy – archive page not showing up
- Custom post type URL structure with site.com/custom_taxonomy_slug/post_name
- Custom taxonomy archive slug overwrites static page
- Custom Post Type tag taxonomy “Page Not Found”
- archive-{custom_post_type}.php not getting recognized wordpress
- Archive.php is not displaying tags
- How to display custom post types AND regular posts separately on a shared taxonomy archive?
- Taxonomy Query of Custom Post Displays Archive Instead of Posts
- How to have a dynamic slug and rendering the archive-{post_type}.php?
- Show custom category archive as front page and remove taxonomy slug from urls
- Custom Taxonomy as checkbox or dropdown
- WP_List_Table Inside Metabox Not Working on Submit
- How to filter post data with AJAX on page?
- Custom permalinks
- Maintaining WP_Query Relation Among CPT, Custom Taxonomy, Permalinks- CPT UI
- Add filter to wp_list_categories and query what type of taxonomy-terms it use?
- Custom post type category, taxonomy and URL rewrite problem
- Get child terms of current term of the current post
- Allow duplicate slugs for posts on Custom post type in different categories/taxonomy?
- Assign category to front end post
- How loop through posts based on custom fields
- Listing taxonomies from custom post type
- Custom Taxonomy Hierarchy for Custom Post Types (eg Categories and Subcategories)
- Output the content of a term organised by each of the CPT?
- How to create a permalink structure with custom taxonomies and custom post types like base-name/parent-tax/child-tax/custom-post-type-name
- Generate Shortcodes by Taxonomy
- Is there a way to connect a custom post type to another custom post type’s taxonomy? (specific to locations)
- How can i change the output of posts_nav_link();
- I have 2 post types i need to show the post type contents in 2 select boxes [closed]
- How can I set taxonomy programmatically
- Don’t know how to show custom taxonomies from a custom post_type
- WordPress loop: Show only a Custom Post Type Taxononmy TERM
- URL rewriting for CTP assigned entity
- How to group posts and get a mixed posts and groups view?
- Control content before and after custom post type loop
- post_type_link Filter – Too Few Arguments
- Archive Page for Multiple Custom Post Types
- Show categories of custom post type and not all posts
- Reusable metabox backend and frontend
- Get A Custom Field From A Custom Taxonomy Of A Custom Post Type [closed]
- Using page title as a link to term archive
- Should i use custom post type for a custom footer?
- best way to use custom taxonomy, post type and meta in a job system
- Display the link of a custom taxonomy
- Custom taxonomy: on the taxonomy term page show other taxonomy terms
- Error 404 change permalink term custom term taxonomy
- Custom post categories are not displaying on the page
- get_posts wont produce a list of custom type from a given category [duplicate]
- PHP Warning with Custom Fields
- Don’t share custom taxonomy terms if applied to multiple Custom Post Types
- How to add independent “Tags” to Custom Post Type?
- Get posts under custom taxonomy and custom post type
- Flush rewrite rules when new cpt is registred
- Shortcode in excerpt
- Show custom taxonomy not in submenu
- Keep same archive.php for post from archive?
- Custom Post Type and Custom Taxonomy not connected
- How to Associate Posts with Pages
- Custom posts and custom taxonomies for many products and categories?
- How to retreive terms associated with a custom post type?
- Create taxonomy from Custom Post Type