Here’s an example that will list all the mobile_review
posts that have the term htc_desire_hd
in the taxonomy mobile_phone
:
$tax_query = array( 'relation' => 'AND' );
$tax_query[] = array(
'taxonomy' => 'mobile_phone',
'terms' => array('htc_desire_hd'),
'field' => 'slug'
);
$args = array(
'post_type' => 'mobile_review',
'tax_query' => $tax_query
);
$custom_loop = new WP_Query( $args );
if ( $custom_loop->have_posts() ) :
while( $custom_loop->have_posts() ) : $custom_loop->the_post();
the_title();
endwhile;
else :
_e('Sorry, nothing here.');
endif;
wp_reset_query();
Now you can have the phones reviews by phone model, you just need to change the phone names, pass the name from a form, URL, etc.
Related Posts:
- Showing current taxonomy terms
- automatically create taxonomy with same name as post title
- Show Two custom Post type and their posts on category page
- display posts of custom post type with custom taxonomy
- How can I group by Taxonomy on Custom Post Type while filtering out based on custom Meta
- CPT: multiple loops with different terms
- Display title of all custom posts from same taxonomy term on a custom post template
- WordPress query posts by custom post type not workng
- Turn post into simple slideshow
- How to develop Knowledge center in WordPress Website
- ACF – Tags not showing up in Custom Post Types
- What does this PHP function code mean? [closed]
- Display all posts in a custom post type, grouped by a custom taxonomy
- Restrict custom post type to only site administrator role
- How do I append multiple taxonomies to the URL?
- Linking Two Post Types
- How to force one column layout on custom post type edit page?
- Custom Taxonomy with Custom Post Type Finds No Posts
- Get custom post type by category in a page template
- Associating an “author” with a custom taxonomy
- WP_List_Table Inside Metabox Not Working on Submit
- modify all posts of a category to “no comments allowed”
- TV Show database – Best way for structuring it?
- Why is the »_builtin« parameter not advised in »register_post_type()« for custom post types?
- Correct way to use a form to to filter custom posts by taxonomy terms?
- Custom permalinks – post type – hierarchical taxonomy’s
- Order custom posts by taxonomy?
- Newer/Older posts links display same posts on every page
- Query posts by custom post type and custom taxonomy
- Conditional two level dropdown filter for custom post type
- How do I write this SQL statement for Posts written in last 24 hours?
- get_template_part for custom post type content not working
- Remove All, Published and Trashed Post Views in Custom Post Type
- How to customize admin posts based on the user who is logged in
- Loop on front-page.php
- Custom Taxonomy – Tags Metabox is showing instead of Categories
- How to post twitter like updates on wordpress
- wp_query to find posts by year and month
- How to create an advanced filter search?
- How to get all posts except for one post from a certain custom post type?
- apply filters only to specific post listing without check the url parameters
- Custom Post Type Taxonomies -Posts not showing in Category or Tag pages
- Custom post type and body_class: Remove “blog” class
- Custom Post Type Loop within Shortcode
- How to insert content from another Custom Post type into Post?
- Weird problem happening with custom taxonmy when creating/updating posts
- Deleting Custom Post type data using mySQL command
- get_template_part for each level of taxonomy term
- Filter by custom taxonomy slug on a custom post type
- Normal pages as children of my Custom Post Type
- Only show posts from a certain category?
- Is there a way to have the view link on manage posts page to open in a new window or tab?
- Display CPT posts based on specific taxonomy
- How i can add ‘N’ page of ‘N’ pages under posts loop?
- WordPress Genesis custom taxonomy archive shows 3 repeats of each post
- Am unable to reset a query properly
- get_attached_media() on author page not working
- Display only one post each WEEK
- Get next and previous 3 posts in a term in single post page
- Loop custom taxonomy to get lists of cutom post types?
- Missing Posts in Custom Taxonomy List
- Custom loop with multiple taxonomy queries
- Disable block with taxonomies at post page
- I would like to have different styles for my posts based on the content of each post
- Which post does a taxonomy term belongs to?
- Custom post type multiple loop by taxonomy term
- A question on creating filters for custom posts using taxonomy
- Conditional Query of Custom Post Type and custom taxonomy
- Show a Category X’s custom post type on Category X archive page?
- Meta query for custom post type ignored in main query
- How do I move/order posts with a tag to the end?
- Display all taxonomy terms, add class if term applies to current post
- WordPress sort search results by custom order
- Return the latest post from a custom Taxonomy and Post Type
- Displaying CPT and custom taxonomy side by side in Bootstrap 4 component
- Use same slug base for Custom Post Type posts, and multiple taxonomy terms
- Hide parent categories when clicked, and show it’s childs
- Get related posts of child term of custom post type
- Group CPT posts by custom taxonomy
- Show titles, date of all posts on single category page
- How to start a new post with custom Taxonomies already set?
- What’s the WP way to load remaining custom posts?
- Update postmeta Parent when post_status child change
- Display Custom Taxonomy Alphabetically
- Full Custom Post Type List Organised by two Taxonomies
- Shortcode not working with post counter
- Allow users to create posts without logging in?
- How to add attributes to taxonomies that may be different from post to post?
- Migrating a taxonomy’s tags to the native category
- Listing all term items alphabetically / sorting loop
- How to produce a sub-page-system in WordPress
- Display related custom taxonomy posts in sidebar
- Only show posts with date of today or in the future (i.e don’t show past posts)?
- Custom Post Type Category Link
- Custom Post type category pages template and loop
- Three Most Recent Posts, One Per Term
- How to sort posts in a custom post type by title in ascending order by default?
- get_the_title() is returning results from previous loop
- WP the_posts() on single-cars.php get category link
- Conditional for a Single Post That Belongs to a Category?