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
- Sorting main query by custom taxonomy slug
- WordPress Custom post query sorting does not work
- List related terms + taxonomies
- Display all posts that use a custom taxonomy
- Set tax_query conditionally with new WP_Query
- querying posts by custom taxonomy terms right from a querystring based URL
- Custom taxonomy.php not working
- Search Query for Multiple Terms In Same Taxonomy
- Is_single() conditional tag returns null in query
- 2 wordpress loops showing 1 post from same post type – how to avoid showing the same post?
- Transient api Caches confused
- Query custom taxonomy by term id?
- Include current post into loop
- If Custom Taxonomy
- How can I reduce amount of ifs and else ifs in this specific block of code?
- Returning One custom taxonomy term name
- How to add div blocks after certain set of post
- WP_Query() with custom post type and taxonomy — get all terms?
- How to overwrite orderby with add_query_var
- When filtering query on custom taxonomy; main menu dissapears
- Exclude recently updated post from custom WP_Query using multiple loops
- Why can’t I use an array of term slugs in WP_Query?
- wp_query not resetting, last post hanging
- Problem with wordpress pagination
- How to do a particular wp_query taxonomy search
- How to add custom meta to ‘pre_get_terms’?
- Should I reset $wp_query?
- How can I get all the posts that are related with a specific taxonomy term?
- Multi level archive
- Get posts of an specific term of a custom taxonomy
- Custom query for tag and custom tag from 2 post type
- List active taxonomy terms
- Ordering Posts by parent category, name ascending
- WP_Query secondary query failing
- Query Pulling the same post twice
- Custom loop – Isolating post meta output depending on current query taxonomy terms
- Is it possible to add query parameters on the archive page?
- sort Posts by custom user filed
- Loop with Custom Post Type and Taxonomies
- How to get name of custom taxonomy
- Loop through multiple custom fields with increasing number
- Advanced Post Display/Pagination/Ordering
- Post data in separate divs with incrementing class using WP_Query
- Why I obtain this WP_Query strange behavior trying to select posts having a specific tag?
- Can I use multi (sub) levels of relation (AND | OR) on custom query?
- Tax Query not working
- How do you move custom fields to custom taxonomies using WP Queries
- WordPress hiding posts without content on custom taxonomy query. How to solve?
- Custom taxonomy – query returns an error
- Run next query based on first query’s term
- Query Number of Loaded Posts in Loop
- 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?
- Order posts with custom taxonomy array
- meta_query dates from an array
- How to perform a search inside a specific taxonomy category
- How to display elements of different post types?
- Trying to achieve row posts below category with multiple loops in custom tax
- Getting grandchildren of a post with a specified custom taxonomy?
- Taxonomy Parameters in WP Query to get posts from two different taxonomies
- Adding a query var to taxonomy term archive – gets redirected to the other taxonomy archive page
- WordPress show posts from children terms of a taxonomy term
- Advanced AND tax_query in sidebar with 2 taxonomies
- add_query_arg to look up page title
- Listing custom post type items from a couple of custom taxonomies
- How to query posts that are not related to any term of a taxonomy?
- Using wp_query is it possible to orderby taxonomy?
- How to limit posts to 1 from each term with tax_query?
- Can I use $query->set() (in a pre_get_posts() hook) with a custom taxonomy in WP 3?
- Catergory args causing loop not to show
- Loop custom post type by taxonomy (Category)
- How can I query for all values of a custom taxonomies?
- Get custom taxonomy value of post and output posts in same taxonomy
- display custom post type from register taxonomy
- Main loop querying current template’s info only in custom category archive pages, not my posts
- tax_query not working properly with get_posts
- query grandchildren taxonomy terms
- How do I create a term for every value of a post meta?
- Woocommerce set loop_shop_columns to be 3 in the main shop page loop only and 4 otherwise
- How home my code doesn’t display any feature image? Looping through post from a taxonomy and not getting feature images back
- How to looping taxonomy terms?
- Three different queries on same page
- Complex Custom Loop with Includes
- Query Multiple Post Types and Paginate Newly Created List
- Multiple queries and pagination
- ACF – How to get custom taxonomy term image field
- Grouping posts by 2 different taxonomies