Have a look at the Taxonomy Parameters for WP_Query
. The argument you are missing is include_children
, which by default is true
, you need to set it to false to not include posts in child terms.
Related Posts:
- Custom while loop for hierarchical display of a taxonomy
- Custom taxonomy terms hierarchical navigation
- WordPress get all post with like in terms [duplicate]
- Decrement term in for each
- Fetch posts list from fist CPT taxonomy term and list under 2. CPT
- get_posts assigned to a specific custom taxonomy term, and not the term’s children
- Get terms by taxonomy AND post_type
- query multiple taxonomies
- wp_set_object_terms() is not replacing term, but creating a new one
- Get terms that contain posts that in turn belong to other terms?
- Custom Taxonomies Terms as Post Title for Custom Post Types upon Publishing
- Retrieve single term slug
- How can I add programmatically custom taxonomy terms to a custom type post when saving posts?
- post count is wrong when using same taxonomy for 2 different CPT
- Glossary with Custom Post Type
- How to check if last uri segment is a custom post type or taxonomy term?
- Custom Post Type Archive Template
- Retrieve a specific field from taxonomy term through advanced custom fields [closed]
- Separate Custom Post Type Taxonomy by Comma
- Sort the main query in subcategories/terms?
- Get child terms of current term of the current post
- Custom Taxonomies: Multiple Hierarchical Permailnks For A Single Post + Prev/Next Links
- How to query custom post type by term?
- Hierarchical Custom Post Types or Similar
- How to get the first term for the current taxonomy?
- Output the content of a term organised by each of the CPT?
- How to create a permalink structure with custom taxonomies and custom post types like base-name/parent-tax/child-tax/custom-post-type-name
- How to filter the taxonomy terms based on another taxonomy term
- Custom Post Type with two hierarchical Custom Taxonomies: strategy to generate best permalink structure
- How to check the terms in single custom post type template
- Display custom post type in hierarchical order with get_terms
- get_the_terms return only last term
- Show listings from Impress Listing plugin in random order using taxonomy and terms
- How do I display tags for a custom post type single page?
- Custom Post Type / Two level deep taxonomy (cat. and subcat.) uri problem (error 404)
- using $wpdb to get custom post type with term
- Show posts from two or more custom taxonomy terms
- Allow user to set custom order to a list of custom taxonomies?
- Which post does a taxonomy term belongs to?
- Issue on Creating Custom Tax Term Dynamically From Another CPT Meta-box On Publish
- WordPress loop: Show only a Custom Post Type Taxononmy TERM
- How do I require the specification of term in a custom post type and custom taxonomy?
- Get terms that contain posts that in turn belong to other terms?
- How to get custom posts sub category link
- Hierarchial Custom Post Types/Taxonomies
- Hierarchical permalinks for custom post type and taxonomy
- Displaying custom-taxonomy-terms sorted by parent/child-hierarchy?
- Custom post type Permalinks with hierarchical Taxonomies
- Create a permalink structure with custom taxonomies and custom post types gives 404
- Query posts with double taxonomy
- Adding predefined terms to a taxonomy
- Custom Post type & Taxonomy 404
- Custom query – get_the_terms not work
- How to Display Posts From Category Within a Custom Taxonomy?
- Shared terms between taxonomies
- Creating a non-hierarchical Taxonomy that behaves like categories
- get_terms() returns Trying to get property of non-object error for custom taxonomy
- how to count the current posts terms
- Urls in Custom Post Type work for Terms but not for its Taxonomies
- Custom Taxonomy Terms in Menu lead to which page?
- Can’t pull posts of a Custom Post Type based on the custom taxonomy of the CPT
- Add custom post type taxonomy tag to article class
- Custom Taxonomy dont save in a frontend form for post a custom post
- Add filter to Admin list for all custom post types by their custom taxonomies
- Add the custom post term to the custom post title
- Retrieve Custom Taxonomies with Description and Slug
- How to list posts by term (custom taxonomy)
- Custom taxonomy not saving correctly
- Display a random customposttype2 excerpt in single-custompostype1.php that shares same taxonomy
- Taxonomy terms with the same name are updated between separate custom post types
- Add a class to a div if custom post type has specific terms?
- Return multiples taxonomies with wp_get_object_terms
- get_posts wont produce a list of custom type from a given category [duplicate]
- Excluded Custom Taxonomy Term Posts Displaying in loop
- How to order taxonomy terms by most recent post?
- Query a custom taxonomy in a function to create an csv file
- Create a Hierarchical List of Custom Taxonomies AND Posts
- week days sorting based on starting day
- Saving Child Terms on front end not setting parent
- order taxonomy alphabetical
- Display a Custom Post Type within another with hierarchically slug
- Filter Term By Parent Term – Custom Post Type
- Display all Custom taxonomy terms and their relevant custom posts
- Custom Post Type categories at edit post not hierarchical
- Best way to group posts based on custom post type terms
- How can I add a “fake” parent into the permalink?
- Get list of CPT posts in *current* post’s taxonomy term
- How to retrieve the permalink for a specific (custom) term?
- Exclude Custom Post Type from shared Custom Taxonomy
- Remove Custom Taxonomy Slug only without removing Custom post type slug in permalinks
- Get a list of categories ids
- Get term_id for each instance of custom taxonomy
- List a custom taxonomy’s terms, with links, on the taxonomy page
- Custom taxonomy archive not showing posts of certain child taxonomies
- taxonomy terms array not working
- install.php Custom Taxonomy Term not being added to custom post
- get_the_term_list() wanting to loop through the returned values
- show 10 most recent custom post types excluding the one(s) from specific custom taxonomy
- Create a hierarchical list of posts that’s grouped and nested by category
- Taxonomy Archive URL + Template