Looks like you’ve excluded a taxonomy term, not the whole taxonomy. Is that what you intended?
But on to the answer…
Right before your query in the widget add:
remove_action( 'pre_get_posts', 'exclude_category_posts' );
And then you probably want to put it back again after that query by repeating:
add_action( 'pre_get_posts', 'exclude_category_posts' );
That is a bit of a “dirty” method and assumes that this is your site and your widget. You may need something more complex if circumstances are different from that.
Related Posts:
- Using WP_Query and Query_post for the loop?
- How do I exclude a custom taxonomy from the post loop
- Display category posts grouped by taxonomy
- display posts with same taxonomy term
- Including all terms in wordpress tax_query
- Display one post from each term in a custom taxonomy [closed]
- wp_query orderby title and meta key value (WP3.1)
- Looping Through Custom Tax Terms and Displaying All Posts For Each
- How do I Use Multiple Loops with WP_Query?
- How to get the term description in a taxonomy term archive query?
- Query pages by child term
- Custom Taxonomy + JQuery Tabs
- Loop posts without any taxonomy
- Using wp_query is it possible to orderby taxonomy?
- Should we trust the post globals?
- Display all posts in a custom post type, grouped by a custom taxonomy
- WP_Query: query posts by ids from array?
- restrict_manage_posts not working in 3.3.1
- pre_get_posts with get_posts
- Query Custom Meta Value with Increment
- Using tax_query creates a 1 = 0 or 1 = 1 in $wp_query->request
- Identify which loop you are hooking into; primary or secondary?
- Retrieving custom taxonomy in order, but excluding specific tax IDs
- Is it possible to sort the post based on a custom field?
- On Taxonomy Template page, want to add Post_Type
- Querying Posts by Taxonomy From Alternate Network Site
- The next_posts_link() show me a aditional page in blank
- Help with a query not working with custom taxonomy
- Should unaltered default loop/query return a list of custom posts belonging to a custom taxonomy?
- Transient pagination not working properly
- meta_query on a date range using an array of values
- Query for posts in 2 taxonomies
- why do drafts return as part of wp_query?
- How to handle “the_terms” inside loop
- How to Loop within a Loop (Display Children and then Grandchildren)
- Taxonomy.php issue with search and filters
- Is it possible to create a shortcode that will query a post based on taxonomies?
- wp_query to find posts by year and month
- Querying Term Posts in Loop
- Upcoming Event: How do I sort database by custom date field, but ignore past dates?
- Custom Post Type Loop within Shortcode
- How to adjust code to refresh a dropdown box with tags that are active on filtered category listing
- $wpdb query a post type within a specific taxonomy term while ordering posts by custom meta value?
- Display CPT posts based on specific taxonomy
- How can marge these loop code?
- How do I display a list of posts under all hierarchical children of the current taxonomy?
- Am unable to reset a query properly
- Query custom post type by custom taxonomy (category slug)
- Display all posts for taxonomy term across multiple custom post types
- Query last updated posts (posts updated in the last 24 hours)
- Excluding pages in WP_query using ACF
- get the taxonomies terms associated with users
- Search form not working with custom query?
- where is the 4th taxonomy terms? taxonomy terms is disaapearing in the loop
- Post loop for all taxonomy terms
- WP_Query orderby and tax_query
- Exclude the first ‘n’ number of posts of a tag from home page?
- Is_single() conditional tag returns null in query
- Query custom taxonomy by term id?
- Include current post into loop
- How can I reduce amount of ifs and else ifs in this specific block of code?
- How to add div blocks after certain set of post
- Why can’t I use an array of term slugs in WP_Query?
- wp_query not resetting, last post hanging
- How to filter query loop block with a search string from the query parameters
- display posts of custom post type with custom taxonomy
- Exclude latest post from WP_Query taxonomy term loop
- Several taxonomy query (like filter)
- Wp_query…a type of term a different div
- Taxonomy archive template that shows posts from more than one taxonomy
- Query custom taxonomy for category including children
- Proper way to create taxonomy queries
- Cant’ Display Custom Post Type Title Base on Tax Terms
- Only display latest custom taxonomy post
- Get 1st parent category id from post
- Chaining Taxonomy Queries
- Query Multiple Custom Taxonomies
- What is the most efficient way to execute recursive complex queries?
- Group posts in a category based on tags in custom taxonomy
- How to loop custom posts that have an exact match in taxonomy terms?
- How can I group by Taxonomy on Custom Post Type while filtering out based on custom Meta
- ACF – Get unique values of array
- Remove Custom metabox from particular page template is used
- WordPress search form and search result through ACF field in custom taxonomy
- Get posts of an specific term of a custom taxonomy
- Is it possible to add query parameters on the archive page?
- Loop with Custom Post Type and Taxonomies
- Loop through multiple custom fields with increasing number
- Can I use multi (sub) levels of relation (AND | OR) on custom query?
- Get the original menu item name string instead of the label
- How to use tax_query other than by slug or id or solve custom taxonomy tags conflicts with pre-existing tags?
- Advanced AND tax_query in sidebar with 2 taxonomies
- Listing custom post type items from a couple of custom taxonomies
- Using wp_query is it possible to orderby taxonomy?
- Catergory args causing loop not to show
- Get custom taxonomy value of post and output posts in same taxonomy
- tax_query not working properly with get_posts
- How do I create a term for every value of a post meta?
- How home my code doesn’t display any feature image? Looping through post from a taxonomy and not getting feature images back
- Complex Custom Loop with Includes