As @Milo’s pointer said, this:
- Sadly, is normal WordPress behaviour.
- Can be suppressed using
parse_tax_query
andinclude_children
set at0
…
The code found in the answer at https://wordpress.stackexchange.com/a/202773/39300 Works for me…
function taxonomy_archive_exclude_children($query){
$taxonomy_slugs = ['product_category', 'application_category'];
if($query->is_main_query() && is_tax($taxonomy_slugs)){
foreach($query->tax_query->queries as &$tax_query_item){
if(empty($taxonomy_slugs) || in_array($tax_query_item['taxonomy'], $taxonomy_slugs)){
$tax_query_item['include_children'] = 0;
}
}
}
}
add_action('parse_tax_query', 'taxonomy_archive_exclude_children');
// An empty $taxonomy_slugs array will exclude children for all taxonomy archives.
parse_tax_query
fires at taxonomy time, include_children
0 is where I can deny children from appearing.
Related Posts:
- Get the taxonomy of a post hierarchically
- WordPress Doesn’t Generate Taxonomy Archive
- Suggested Post and Taxonomy structure
- Custom post with more than one custom taxonomy
- Custom while loop for hierarchical display of a taxonomy
- Adding custom taxonomy in same menu place with two custom post types
- How to make custom taxonomy into drop down select in a custom metabox
- How to get list of taxonomy slugs ordered parents>childs?
- Custom post type / taxonomy rewrite archive page 2 gives 404
- Create more category hierarchical depth for custom post type/taxonomy plugin (widget)
- Hierarchial Custom Post Types/Taxonomies
- How do I share categories across multiple post types?
- Hierarchical permalinks for custom post type and taxonomy
- Multiple tag cloud filtering
- Get url.com/post_type/taxonomy/term work!
- How to display products name in a non-alphabetical order, in a custom field (taxonomy)?
- Taxonomy in URL
- Custom post type Permalinks with hierarchical Taxonomies
- Create a permalink structure with custom taxonomies and custom post types gives 404
- Different Category system needed for the Custom Post Type
- Custom Post Type Category Link
- Custom Post type category pages template and loop
- How to Set Taxonomy Object Description?
- Custom select query for taxonomies that have posts categorized in another taxonomy
- Custom Taxonomy Is Being Pulled into a Page, But It Doesn’t Have A Hyperlink
- Querying two taxonomies with tax_query not woking
- Rename a slug label
- Custom Post type & Taxonomy 404
- Hide specific taxonomies from a taxonomy list using ‘get_object_taxonomies’
- Custom taxonomy (categories) on custom post type return no results
- Variable not working in WP_Query
- Hide meta box for everything BUT a certain custom post type
- get_category_link() for custom post type does not include custom slug rewrite?
- Targeting categories in custom fields
- How can I create an automatic drop down menu with my tags?
- How to define a term for custom taxonomy
- List custom taxonomy as navigation – taxonomy pages with all it’s posts?
- Alphabetically sort a taxonomy.php template by post title
- Custom Post Types not queried in Custom Taxonomy archives or Native archives
- Get taxonomy singular name instead of taxonomy slug inside $taxonomy query
- Show Taxonomies with admin area for custom post type?
- Custom taxonomy template list not working (404)
- Use the custom post type archive for taxonomies?
- Rewrite custom post type with taxonomy
- custom hierarchical taxonomy and custom post type list contains surplus posts
- WordPress multisite – is it possible to have different taxonomies for each site?
- Creating a non-hierarchical Taxonomy that behaves like categories
- My custom taxonomy is only displaying 1 of 3 terms
- Query custom post types & Taxonomies and list them in a table on a page
- Taxonomy template page not working
- Migrating Hierarchal Taxonomy Categories Between Post Types
- How to show list of taxonomy terms associated with specific post?
- Changing CPT slug and taxonomy already registered in parent theme
- Ideas on how to organize a project [closed]
- Creating custom post type posts and associating them with a post from another custom post type
- I have custom post type with custom taxonomy. But not found the taxonomy page..
- Group Custom post type in a taxonomy page by its child taxomony
- Copy/Move selected taxonomy terms to another taxonomy for posts
- How should I structure complex content hierarchies?
- Custom Taxonomy Terms in Menu lead to which page?
- Getting List of child terms from custom taxonomy parent
- Get posts by category name
- List child categories from parent category on custom taxonomy page
- Custom taxonomy query showing more than 4 posts
- Using page title as a link to term archive
- Custom Post taxonomy template
- Query Multiple Custom Post Types & Exclude a Taxonomy Term
- How to display posttypes and taxonomy in standard posts, not in a separate label?
- Query Custom Post Type by Taxonomy
- “Menu order” being ignored when querying posts from a parent taxonomy with “include_children” set to true
- How to get post count of specific taxonomy that have store name & category
- Duplicate slug/permalink issue while adding same post name
- Get the taxonomy value in the post loop inside the archive page
- Filter taxonomy by CPT
- How to show related posts of category on post within custom posttype
- How can i display a taxonomy? i have created a plugin and then a custom type. and a taxonomy , also i have register it
- Custom taxonomy terms hierarchical navigation
- Define multiple prefixes for custom post type
- How to order taxonomy terms by most recent post?
- Custom taxonomy returns 404 even with saving permalinks
- Create custom post type categories
- How to add CSS class field in Custom Taxonomy?
- WP_Query for custom taxonomies showing posts from non-specified terms?
- Taxonomies are not showing in the category dropdown
- Change custom post taxonomy values from front-end
- Display 3 level taxonomies
- Set a Default CPT taxonomy by taxonomy id
- Get all posts for custom taxonomy term
- List posts that have the current url taxonomy
- Listing all custom posts having a specific taxonomy whatever the terms
- List all posts associated under custom taxonomy
- How to transfer categories (default) to custom taxonomy?
- How to Use A Custom Post Type as Taxonomy for Another Custom Post Type
- How to manage a dynamic multi-level page hierearchy system?
- Custom Taxonomy – fields
- Display custom tax in “while” loop
- Categories manage
- Add other all taxonomies as meta boxes to custom post type
- How to get post type archive category title
- Pages of my taxonomy terms are showing all posts