You’ve hard-coded the term into the second query. Of course you are seeing the same thing every time:
$terms = get_terms(
'model',
array(
'orderby' => 'count',
'hide_empty' => 0
)
);
if (!is_wp_error($terms)) {
foreach( $terms as $term ) {
// Define the query
$args = array(
'post_type' => 'peterbilt',
'tax_query' => array(
array(
'taxonomy' => 'model',
'field' => 'id',
'terms' => $term->term_id
)
)
);
$query = new WP_Query( $args );
// more code
}
}
Related Posts:
- Taxonomy, Terms, and Template Files
- How to pass URL parameters for advanced taxonomy queries with multiple terms for one custom taxonomy
- Templates for Custom Post Types and Custom Taxonomies
- Get page by template?
- Custom taxonomy query for a custom post type
- Need some templating advice for templating with custom post types and taxonomies
- Custom Post Type with Nested Taxonomy and Template Files
- Custom Post Type Archive Template
- custom post type archive template per custom taxonomy term
- custom taxonomy – Template not working
- Include different loop templates in search query
- Create separate template for shared custom taxonomy with shared terms
- Trying to manage templates on a blog with lots of custom taxonomies
- How do I provide a “show all posts” link in a paginated term archive?
- Custom Post Type Taxonomies -Posts not showing in Category or Tag pages
- Query with no terms uses index.php template instead of archive.php
- Create template for taxonomy results limited by Custom Post Type
- Template for custom post with custom taxonomy
- Custom taxonomy and custom post type – wrong permalinks and template
- WordPress Doesn’t Generate Taxonomy Archive
- Custom taxonomy returns 404
- Template for all categories of a custom post type?
- Migrating a taxonomy’s tags to the native category
- WordPress custom taxonomy template not working
- How can I get this request to use the Custom Post Type page template instead?
- Archive for a Taxonomy of a Custom Post type
- Template files for Custom Post Type and Taxonomy
- Main query not querying any posts in custom taxonomy template
- Which file/template is in charge of taxonomies for custom post types?
- How to get_term_meta on single custom post?
- Get template part with CPT and Custom Taxonomy conditionals
- How to create a template to show child terms of a MAIN taxonomy
- How to change single custom post template by custom taxonomy?
- Create a custom taxonomy template that loops through child categories in term order?
- Post template with breadcrumb needs to show page navigated from
- Custom Post Taxonomy Template Not Loading Properly
- taxonomy – templates are not loading
- Custom taxonomy with custom post type template not showing
- Custom taxonomy template for custom fields loop [closed]
- Templates for CPT not working
- Single taxonomy for different custom post types
- How should i name the .php file to show custom posts under a taxonomy’s term?
- I want to create an archive and single page for a custom taxonomy for a custom post type
- Custom Post Type tag taxonomy “Page Not Found”
- template structure for CPT not clear
- WordPress Custom taxonomy template
- How to display custom post types AND regular posts separately on a shared taxonomy archive?
- Querying multiple taxonomies in URL leads to wrong taxonomy archive
- Listing all custom post types using a specific term on the said term’s template page, in groups
- Most appropriate way to display CPT’s by children terms of custom taxonomies while retaining desired permalink structure?
- Only One Post of Custom Post Type Appearing on Template Page
- Custom Post Types using wrong template (index) instead of archive-{type}.php – previously worked as expected
- Custom Post Type Permalink / Rewrite not working immediately
- How to add custom content template part for a custom post type on main query using a plugin
- Custom Post type in separate database table for syncing
- Creating Photo Gallery System with Custom Post Type
- Custom Taxonomies Terms as Post Title for Custom Post Types upon Publishing
- WP_Query -> sort results by relevance (= most tags / taxonomy terms in common)
- Correct way to use a form to to filter custom posts by taxonomy terms?
- Using Custom Templates for Custom Post Types for the Genesis Theme Framework?
- Custom-Taxonomy as categories: Remove “most-used” tab?
- Custom Permalinks for Custom Post Types and Taxonomies
- how to group custom post type posts by custom taxonomy terms
- Showing current taxonomy terms
- Custom Taxonomy order by Custom Field
- Custom Post Type: How to display all of same taxonomy?
- Show ACF field from custom taxonomy and display on the single template
- Display custom post type in hierarchical order with get_terms
- Am unable to reset a query properly
- Custom Post Type permalink shows wrong page: homepage/index.php
- Display Custom Toxonomy In WordPress and theme Widgets category selection dropdown list
- How do I require the specification of term in a custom post type and custom taxonomy?
- Custom Post Type Pagination Paginates Only in URL Structure
- I am trying to hide a custom post type category to logged in users with Pre_Get_Posts
- Hierarchial Custom Post Types/Taxonomies
- Only show posts with date of today or in the future (i.e don’t show past posts)?
- Using page slug in wp_query
- previous_post_link in same taxonomy in custom post type
- Rewrite custom post type with taxonomy
- Display both parent and child custom taxonomy / content
- how to count the current posts terms
- Add custom post type taxonomy tag to article class
- Custom Taxonomy dont save in a frontend form for post a custom post
- Query Custom Post by taxonomy multiple categories
- Change Dropdown jQuery to show/hide but with default place holder that shows all
- Get Posts List of Current Selected Custom Taxonomy in Shortcode
- Get the taxonomy value in the post loop inside the archive page
- How to display custom post type taxonomy in Contact Form 7 text field
- Custom Post Type & Taxonomies – Rewrite
- Change CPT permalink to use the category
- Previous/Next custom post links within custom taxonomy
- Pretty permalink structure with multiple (AND OR) taxonomies
- Override “Parent” input for custom taxonomy
- Why is this custom post type defaulting to archive.php?
- Sorting custom post types by taxonomy (So close)
- Check if taxonomy is attached to at least one post in a post-type
- Getting (Invalid) when adding custom taxonomy of custom post type link in menu [closed]
- Display custom taxonomy posts of custom post types
- Custom Post type as Taxonomy
- Get X posts with the same terms as the current post (custom post type and custom taxonomy)