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
- Get the children of the parent category
- Control term order on a per-post basis
- How do I get the category URL from get_the_category?
- Default WP Gallery – show only galleries of a certain category
- Display all posts in category, with specific tag posts at top
- Create terms when registering taxonomy?
- How to convert regular categories to custom taxonomy?
- Does WordPress Offer a Way to Find All of the Categories that Don’t Have Children?
- Removed slug from CPT, now How/where do I hook the filter to the taxonomy term archive pages link?
- wp_list_categories, Add class to all list items with children
- Connecting WordPress gallery to custom categories (taxonomy)
- New categories are now going to 404s
- Category archive page – loop through posts of certain tag (with pagination) – pre_get_posts
- “Reversable” and “Re-useable” Subcategories (or other taxonomic structure)
- If newest post of category is newest post in general, skip first post of category
- If statement within PHP echo
- Taxonomies for WordPress Media Library [duplicate]
- Why would in_category only return one post in a specific category?
- How to create new category for custom post type?
- display taxonomy slug from term ID
- Taxonomy filter all children
- Force a user’s posts category
- Search Posts / Pages with multiple options?
- Second level subcategory
- Categories of custom taxonomy don’t show any posts
- Multiple Loops on category.php with pagination on last loop
- Why don’t posts show up in my categories on the frontend?
- Get posts from specific taxonomy term
- How many categories can WordPress handle before performance suffers?
- Display single category name in woocommerce loop
- Show Posts from Single Category Not Working
- Problem with different query loops (and “main loop”) on category template page!
- How to do paging in the loop?
- How to loop custom post_type from (a) specific category(ies)?
- Some categories missing on wp-admin/edit-tags.php?taxonomy=category
- custom page for custom Taxonomy
- Display posts of certain categories to specific user roles
- Eliminate word from $term->name
- Filter By Category Dropdown List With Custom Taxonomies
- query_posts by category_name and custom taxonomy
- get_terms() parent, child and grandchild
- How to schedule categories?
- Problem with multiple loops in wordpress theme
- multiple values in an array for category__and does not work with WP_Query
- Copy post taxonomy?
- How to load several hierarchical categories from functions.php
- Posts not listing out sub category in hierarchy
- Disable Category Taxonomy
- How to set acf color field as background color to product category
- How to target all woocommerce categories that don’t have any subcategories in them?
- How can i echo next and previous custom category from a Taxonomy
- How to show category list in WordPress
- get taxonomy list in a page in the wordpress
- Number of categories slowing down the site
- How to load terms of a custom taxonomy of a product in woocommerce cart page
- Custom taxonomy shows full articles
- Custom post types not displaying per category
- Dynamically creating content on custom URL without getting 404
- How to exclude category and post_tag taxonomy while displaying custom taxonomy?
- List Terms by category
- Display one post on category.php: Wrong featured image
- WordPress Numeric Pagination with Query String [duplicate]
- Taxonomy for custom post type not found
- Printing direct descendants of a category with WP_Query
- Assign a category by user and customize the edit-tags.php?taxonomy=category page
- How do I hide posts in a category from all listings but still allow the posts to be viewed?