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?
- get_term returns different results, sometimes empty, sometime the correct list
- Categories list loop – add separator every 3 categories [closed]
- Targeting Parent Category Pages
- Wacky taxonomy in wordpress
- get_terms function not returning anything
- Limit get_categories to show each category once
- Why custom taxomony not showing when create a post?
- Limit categories and it’s subcategories for specific group of users
- Display single category name in woocommerce loop
- Ive got a term (get_term_by) but now I want to filter it by a category it is in?
- How to display parents category and child category separately for a specific post?
- Include WooCommerce product to all child categories
- Admin: Navigation Menus do not show empty categories/taxonomies in the list’s search tab
- Show Posts from Single Category Not Working
- Notice: Trying to get property of non-object in : custom fields category
- add slug beside name in Admin Category Checklists
- get_category_link() for custom post type does not include custom slug rewrite?
- Is there a reason I cannot get the current category in a loop?
- Category archive is displaying all posts rather than the specific category
- Targeting categories in custom fields
- Pagination on category.php and tag.php not working
- new WP_Query all post in a category inside the loop
- Trying to get variables in hacked category dropdown
- Problem with different query loops (and “main loop”) on category template page!
- How to do paging in the loop?
- How to add orderby parameter for sorting on category.php
- Target a specific category from a custom taxonomy?
- Trying to add taxonomy to get_categories() but it’s not working. How to fix this?
- Get Categories Where Taxonomy Equals ‘n’
- category__not_in and id values from variable
- Display sibling categories on category page
- How to modify the output of wp_terms_checklist when used within the built-in category metabox on edit posts?
- How to loop custom post_type from (a) specific category(ies)?
- Do not show sub categories in the loop on archive-product.php
- Having a template per category? Bad for server overhead?
- WP REST API not retrieving all categories
- How to display a value inside a post with a specified category from a category custom field? [closed]
- Some categories missing on wp-admin/edit-tags.php?taxonomy=category
- List just subcategory and products of active category page in Woocommerce
- How to display the parent category if only the child category has been chosen
- custom page for custom Taxonomy
- Category tags with comma’s
- Display posts of certain categories to specific user roles
- My custom taxonomy is only displaying 1 of 3 terms
- Allow user to select categories that will display in post loop
- Grandchild Term Things Grandfather Term is It’s Parent
- Insert HTML content in WP Query at specific point
- Eliminate word from $term->name
- What Must to Display the “mysite.com/category” URL?
- Custom page category taxonomy 404
- Simple way to style posts of a single category differently in the loop and in single
- WP 4.7 in_category change?
- Loop through custom taxanomy in post and display custom fields from posts
- Remove any product that is featured from regular display loop [WooCommerce]
- Two Sections on Woocommerce Catergory Page [closed]
- Get posts of a custom post type from category from taxonomy?
- Getting the Most Recent Posts from Multiple Categories
- Filter By Category Dropdown List With Custom Taxonomies
- query_posts by category_name and custom taxonomy
- get_terms() parent, child and grandchild
- How to get posts by category and by choosing a taxonomy term?
- Is it possible to create an alias/custom taxonomy for a category name?
- Display subcategories in dropdown
- Illegal string offset ‘taxonomy’ in
- Style a category from category list