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
- Display all posts in a custom post type, grouped by a custom taxonomy
- Restrict custom post type to only site administrator role
- How to force one column layout on custom post type edit page?
- Newer/Older posts links display same posts on every page
- Conditional two level dropdown filter for custom post type
- Show all custom post type posts sorted by custom taxonomy then by another custom taxonomy
- Assigning a role to a specific custom post type (and ignoring other post types)
- Display posts in random post types
- Custom Post Type by user
- How to create posts (not post template) to be displayed on projects page?
- Should unaltered default loop/query return a list of custom posts belonging to a custom taxonomy?
- 404 error PageNavi custom type taxonomy | wordpress
- same archive template for different custom post
- Query for posts in 2 taxonomies
- IF statement in a do_shortcode
- How do you output custom code between posts in the loop?
- Best practice for adding posts in bulk
- WP 3.1 getting tax_query to work in query_posts()
- Impossible to get Attachments Outside WordPress?
- How to dynamically build a multiple taxonomy query loop within a post type’s single loop?
- Remove All, Published and Trashed Post Views in Custom Post Type
- wp_query to find posts by year and month
- Custom Post Type Loop within Shortcode
- Weird problem happening with custom taxonmy when creating/updating posts
- get_template_part for each level of taxonomy term
- Display CPT posts based on specific taxonomy
- WordPress Genesis custom taxonomy archive shows 3 repeats of each post
- Loop custom taxonomy to get lists of cutom post types?
- Disable block with taxonomies at post page
- Conditional Query of Custom Post Type and custom taxonomy
- 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
- Use same slug base for Custom Post Type posts, and multiple taxonomy terms
- Get related posts of child term of custom post type
- Show titles, date of all posts on single category page
- Update postmeta Parent when post_status child change
- How to produce a sub-page-system in WordPress
- Only show posts with date of today or in the future (i.e don’t show past posts)?
- How to Display Posts From Category Within a Custom Taxonomy?
- How to Make infinite loop of post
- WP_Query with custom post type ID
- attach CPT data to a taxonomy
- Creating a non-hierarchical Taxonomy that behaves like categories
- Custom Post type content within a slider
- Custom Post Type and Taxonomy Loop Output Is Wrong
- How to query Posts from a custom post type which contains a custom taxonomy?
- Different structure/content for posts from a custom post type
- Displaying One Custom Post Type’s Content On Single Post of Another Custom Post Type
- custom taxonomy listing returns no posts
- Get terms for a specfic post from multiple taxonomies in custom post type
- How to fetch posts that are stored in the different table than (default) wp_posts?
- Cant’ Display Custom Post Type Title Base on Tax Terms
- Is it possible to have hierarchical taxonomy and hierarchical custom post types in one permalink?
- How do i display post from a taxonomy term?
- If/Else child list for Custom Post Type single template within loop?
- What is the most efficient way to execute recursive complex queries?
- Get Posts List of Current Selected Custom Taxonomy in Shortcode
- How to display list of custom post taxonomy terms and their posts (if any)?
- Excluded Custom Taxonomy Term Posts Displaying in loop
- posts_per_page is not working by term
- subtracting the current post form then whole loop, which is generating all CPT titles
- % encoded URL giving 404 error in WordPress
- Limit posts per page depending on the size of a div?
- Delete Post by User
- Custom post Query and WordPress Post Query Clash
- Add active class to foundation 6 tabs while looping categories
- Help with Travel Guide Setup
- Only show current category post
- Filter By Term Not Working – Custom Post Type
- Problem to get the link of the default ‘post’ post type like the orther custom types
- Looping through custom taxonomy in one template
- How to keep a CPT stick to specific position?
- WP_Query for CPT with filter by another WP_Query
- Loop with Custom Post Type and Taxonomies
- How to create content automatically when a post is published?
- WordPress Custom Post Type and sort by Tags
- Query Only Show Text on Posts With Certain Taxonomy Tag
- Looping taxonomy in taxonomy?
- Listing custom post type items from a couple of custom taxonomies
- Catergory args causing loop not to show
- Query multiple post of which one by taxonomy
- How to make a template for a specific post of a custom post type?
- the_content() stop images being pulled through
- How to create a job post by email parsing? [closed]
- cannot export data from CPT UI (books)
- display posts, pages and custom post types from another wordpress site
- Sort ACF by custom taxonomy
- Create a WordPress loop that shows posts from a custom post type + filters the posts by taxonomies while hiding empty taxonomies
- Add Custom Taxonomy Terms as CSS Classes for CPT Posts in an Elementor Loop Item Template