Well, I should have used the tax_query parameter. Something like the following:
$the_query = new WP_Query( array('post_type'=>'ad_listing',
'tax_query' => array(
array(
'taxonomy' => 'ad_cat',
'field' => 'slug',
'terms' => '7star'
)
)
) );
Related Posts:
- get_categories for custom post type with a specific custom taxonomy attached
- How can I add the featured image functionality to a custom taxonomy?
- Combine two taxonomies in a hierarchical tree
- How can I select a primary category?
- How to make custom taxonomy check boxes like ‘Categories’
- How to create non-unique sub-category slugs?
- How to get next previous category in same taxonomy?
- Getting WordPress custom taxonomy/category?
- Display empty taxonomy terms with get_terms()
- How to get the number of child categories a specific parent category has?
- How can I convert some categories to a custom taxonomy?
- Get multidimensional array that reflects category hierarchy
- Change existing taxonomy settings when using custom taxonomy
- How to get the id from the custom category?
- Taxonomy name repeating when showing 2 posts from each category
- How can I edit the ‘Most Used’ tab in the categories meta-box to show another custom taxonomy?
- Custom Post Type Category Link
- Custom Post type category pages template and loop
- Display custom taxonomy attached to the post on post single page
- Question on using custom structures for categories
- Echo text using is_tag
- Same menu for different taxonomies to reach different content
- How could I write a get_categories_by_year() function?
- Category post count is not correct
- How to set the same base url for two different taxonomies?
- Get WooCommerce product category list in functions.php
- Why use hierarchical taxonomies instead of many custom taxonomies?
- Renaming default category taxonomy?
- How to Manage and link certain custom taxonomy?
- Display List of Categories Within a Custom Taxonomy
- Display Taxonomies in loop with template args
- How to add a post with new Taxonomy without assigning to default category?
- Converting Categories (with ACF fields) to custom taxonomies
- Order Categories by Character Count
- How can I get the categories and subcategories separately?
- How to display non-hierarchical taxonomy as terms with checkboxes?
- How can I list all the categories under a Custom Post Type (taxonomy)?
- WP_Query not looking at child category
- Are Categories, Tags and Custom Taxonomies any different in regards to SEO?
- Display list of Sub-Categories and the posts they contain, within one main Category
- How to Override default update_count_callback for category
- Add custom taxonomy terms to WordPress menu dynamically & append #slug to url
- Check if post belongs to any category
- Order Taxonomy Term by date created
- How do I display the posts from a custom post type on a category.php page?
- Exclude category from loop not working
- Want to hide some categories from the categories meta box in the post editor for the two specific user roles
- Can I use get_adjacent_post for specific categories?
- Can you pre-check wordpress categories?
- Show a Category X’s custom post type on Category X archive page?
- How can i insert term in a specific language of Polylang?
- Remove product category placeholder image (Woocomerce)
- Post loop for all taxonomy terms
- How to “group” (categorize) the Pages together?
- Is There a Difference Between Taxonomies and Categories?
- Get all media categories
- Custom taxonomy/category order
- How to insert category list into post creation page, and retrieve chosen categories?
- Targeting Parent Category Pages
- Include WooCommerce product to all child categories
- Notice: Trying to get property of non-object in : custom fields category
- Pagination on category.php and tag.php not working
- How to do paging in the loop?
- WP REST API not retrieving all categories
- Eliminate word from $term->name
- Is it possible to create an alias/custom taxonomy for a category name?
- Style a category from category list
- Showing HTML if Post is In Certain Taxonomy Term
- I need to exclude from a query a category and a few custom taxonomies
- Get the ID of the current post’s child category
- multiple values in an array for category__and does not work with WP_Query
- List post only under the category, exclude child category content
- Custom Fields Value As Taxonomy
- Exclude posts without category from loop
- get_the_category – display only a single category for a post (not all categories)
- get_the_terms has strange result since version 6.0
- display category with background color
- Page category filter in admin dashboard
- Get post meta value outside of the loop
- How to create a category loop on my blog (ACF Plugin)
- Using heirarchial tags or Custom taxonomies
- Custom taxonomy shows full articles
- Displaying Category in sidebar post widget but not in the loop on home
- Create duplicate category page with content variations
- How to echo Tags and Categories as plain text
- How can I add HTML classes for current taxonomy/term hierarchy into my pages to simplify styles?
- How to get post count including nested categories
- New Category – custom taxonomy
- Loop within category’s posts
- Loop through posts of CatA and store value of CatB in separate array
- How to add an empty entry to masonry?
- Loops in category description
- Several loop in search result
- Why is my post categories not displaying?
- Detecting top parent category fails on home page
- finding out the top 5 source ( source is a custom taxonomy ), in a given category
- How can I implement pagination on custom category page?
- Taxonomy page wpml dropdown not working
- Is it possible for post and custom post type to share a category base slug?
- Two related taxonomies. how to filter terms in second taxonomy depending on selected term in first taxonomy on Post edit page?