Query parsing happens on every query run on a page, not just the main query. Your parse_tax_query
is modifying the query for menu items in your menu. Check is_main_query()
to make sure you only change the main query:
function no_child_terms($query) {
if( !is_admin() && $query->is_main_query() ){
$query->tax_query->queries[0]['include_children'] = 0;
}
}
add_action('parse_tax_query', 'no_child_terms');
Related Posts:
- Generate a tabbed submenu — from taxonomy term or submenu item — with sample content
- Order by menu structure
- Warnings in nav-menu when visiting query pages [closed]
- My Main Query Modification is Messing up my dynamic main – why?
- Set if condition with wp_nav_menu
- Show all data in database table and make it into an interactive table
- wp_trim_words strips dashicons
- How to get current page nearest parent id?
- How to get main menu only with wp_nav_menu
- Displaying Pages in Nav Sub-Menu with Specific Taxonomy Terms?
- How do I hide submenus from the top menu bar?
- Calling body_class and wp_nav_menu for a different post
- Show parent’s child and also child’s, child on a page?
- Broken? WP_Query and “attachment” as a post type
- Order by DESC, ASC in custom WP_Query
- Exclude or Include category ids in WP_Query
- Secondary Sort (fallback) for WP_Query
- Changing the meta_query of the main query based on custom query_vars and using pre_get_posts
- Query Posts in a Predefined Order
- How to stop wordpress to make the default query?
- WP_Query based on URL parameters
- Order by meta_value_num DESC and meta_value ASC on WP 4.0
- Order posts ascending with number in title
- How can I style future post?
- List taxonomy terms plus their latest post ordered by post date
- WordPress altering my custom query, How to fix it?
- Order by meta_key in custom post type doesn’t affect the query
- Is there a PHP function that can match anything after the given URL, so my IF statement will work in each instance?
- Add a default meta_value to new posts
- WP query exclude post within the last month / only show over 1 month old
- WordPress query for most recent posts from multiple categories
- Order Posts by meta value AND published date
- Pass array of taxonomy terms to wp_query
- Comparing dates in custom field
- List of the years with posts presented
- Advanced Taxonomy Queries WordPress
- Use post object from first query in second query
- Getting post revision and printing them on the post content site
- Editing the default wordpress search
- Slow page loads due to WordPress Core Query
- wp_query for multiple cities (multiple values in a metabox)
- Adding column to wp_posts table or join wp_posts table with another table
- get posts by meta_key from inside key of post meta
- Help optimizing slow WP_Query with meta_query
- Pre-Populate $wp_query settings with custom rewrite rules and custom template_redirect
- Pass $page_id to new WP_Query
- WP_Query args to show posts from specific custom taxonomy
- How to query woocommerce product by pricing? [closed]
- Can I modify a WP_Query instance or clone it with modifications?
- Include posts from some categories while excluding from others
- Posts in loop all show the same author when there are many authors
- Show a 404 error page if Public query variable’s value doesn’t exist?
- WP_Query within function within WP_Query
- If have posts a week old, display, else display a different loop
- All blog data on a page using custom query gives 404 for page 2 and onward
- Daily drip of posts – based on user ‘startData’ – ordered oldest to newest
- How to add tax_query to $args with concatenation
- Where is the extra SQL fields coming from?
- How do I fit WP_Query arguments into a function?
- WordPress post filter menu
- Create one-use post dynamically, add to main query, do not insert post (user profile view)
- How to query posts for custom post type with featured image for first 2 post?
- Why is get_the_excerpt returning full content
- How to avoid filling up an array each time I run a WP_query?
- How to SQL query posts IDs by categories AND authors?
- Randomly pick one testimonial post
- Custom post type – filter content by custom meta box content
- Trying to output content from page, works locally but not online
- Admin: Custom Query Returning Permissions Error
- wp query remove posts from query then update max pages and posts found
- WP_Query Orderby meta_key and hide some meta_key
- Combine relationship posts with existing wp_query
- Slick slider for post doesn’t display anything
- What is the equivalent WP_Query of a SQL Query?
- create custom shortcode wp and put php code in
- WordPress Query custom ordering by temporary variable
- Check the stored / cached WP_Query with transients on post change
- Count post meta entries
- use mysql variable in a $wpdb->query to reindex a column?
- How to get only present and past posts with post_date
- How to create better WP_Query to look for date time which is anywhere between two meta values?
- Query WP Posts, then list the taxonomies from those posts
- Query post with content only
- Load WP Query with Ajax
- Search with WP_Query, but ignore href URLs in anchor tags?
- Is meta_key used for ordering, filtering, or both?
- compare for multiple meta values for same key in wp_query
- Taxonomy Terms That Don’t Exist Display Results
- Why is my query not giving results?
- Fetch only categorized posts
- Wrote a WP Cron Plugin and it triggers a fatal error upon activation
- Adding a Theme Customizer Control for Posts_Per_Page
- Custom query from all posts & all child page from one parent page?
- wp_query conditionally get posts
- Getting Year & Date inside wpdb [duplicate]
- the_excerpt() not working in custom archive
- Get posts by meta value except one post [closed]
- Display Featured image from custom post type category (custom taxonomy) wise
- new WP_Query with order args – no more distinction between categories
- How to make OR condition in WP_Query