I think you should be able to do this with a tax_query
in your $args
.
I could not test this, and I also dont know how the query behaves with a meta and tax query in one.
But I would start with testing something like this:
'tax_query' => array(
array(
'taxonomy' => 'event_category', // the used taxonomy
'field' => 'term_id', // use ID or slug
'terms' => array( 2136 ), // term ID to exclude
'operator' => 'NOT IN', // "NOT IN" to exclude?, default "IN"
),
),
Some more infos in the offical codex.
Related Posts:
- WP Query with custom Shortcode
- Query multiple custom post types in single loop
- Inject post (from specific category) between posts in Loop
- retrieve thumbnail from post ID of best selling product in category
- How to create a WP_Query to search the Title or Tag?
- Modern Tribe Calendar wp-query with meta query not working at all
- How to display custom field on homepage
- Can an array be used as a meta_query value?
- Display related products with custom output
- How to get to a specific position in wp_query?
- Get category name from custom loop and echo it once
- Why is variable not working on custom sql query using wpdb?
- Create WP_Query to search for posts by their categories or their parent/child categories
- Advanced Meta Query for Large Calendar Website (12k+ posts) (175k+ wp_postmeta rows)
- Recent Posts Not Showing Only On A Specific Category Page [closed]
- Custom query, checking values of multiple meta keys
- Is it possible to retrieve all posts with a certain value for metadata?
- unable to use ‘new WP_Query’ in AJAX call
- How to add div blocks after certain set of post
- How to overwrite orderby with add_query_var
- WP_Query: getting posts where custom field exists
- How to display SQL query that ran in WC_Order_Query?
- Post not populating for custom post type based on category selection
- Passing an array into WP_Query as a variable
- WordPress meta_query >= &
- Do not duplicate posts with multiple categories in multiple loops
- Using multiple variables to assign categories to an array
- Display latest post from WordPress Featured Category that is also in X,Y,or Z categories
- How can I modify this code to make the search box include tags and meta
- Isn’t Returning Value While Using SELECT COUNT(*) FROM {$wpdb->prefix}
- Is it possible to order posts using multiple meta queries, i.e. show posts from first meta query, then the second?
- wp_Query with mutuplea values returns all posts
- meta_query search names when they have middle initials
- Category Page Displaying all Pages
- Usermeta data unserialize, extract and display in table in WordPress
- Meta query not showing result properly
- wordpress query returning unexpected results
- Query doesn’t display text data with apostrophes
- Efficient way of querying for a “fallback” post?
- How can I display a query in a page?
- Trying to exclude posts from a category on the home page
- Query seems to be duplicated
- Does wp_query and query_posts affect website performance? [duplicate]
- Hide empty categories from get_categories
- Fix incorrect related posts code snippet
- wp_query on search results page showing all results every time
- Show post like this image in my newssite [closed]
- Display all categories (with link) of custom post type – WordPress
- Three different queries on same page
- Exclude a category ID from the following function
- the_date() not working
- Changing the meta_query of the main query based on custom query_vars and using pre_get_posts
- Meta Query with AND & OR?
- How to make an meta_query optional?
- Looking to exclude blog posts from category Previous/Next buttons
- How to exclude specific category from the get_the_category(); array
- Sorting Posts | Alphabetical Order
- spliting posts into two columns
- Looking for most performant way to execute several similar WP queries within shortcodes
- combine Code 1 with Code 2
- List of the years with posts presented
- Echo a hierarchical list of post data from custom fields
- Storing Array from returned database query and using the array in a new query
- How to use an associative array in post__in with WP_Query?
- What query string parameter is available for index.php, that works for both pages and blog articles?
- wpdb php get_var query to get ID for URL image doesn’t work for ID over 999
- get_template_part based upon post’s category
- Exclude posts based on meta value
- Different post styles depending on category
- Query if audio attachment AND/OR custom field
- How Can I use WP_Query to Only Display 1 Post from Custom Post Type if Query Returns Posts with Matching ID in Custom Field
- Define specific category name in PHP
- Include Parent Term in wp_list_categories
- Parse error: syntax error, unexpected ‘}’ on get_the_author_meta [closed]
- I’m trying to create an array with a foreach loop, but the array only stores the last item [closed]
- Custom query vars filters problem with pagination
- Displaying Event within two given time frames
- Remove Post if Advanced Custom Field is checked to fix paging
- Adding wp_list_categories to a specific div that was appended using jQuery
- WordPress Custom Query: Combining Two Functions
- Search AJAX Filters – Multiple Query Loops Into One Loop (Optimization)
- WP_Query: How to get results from both meta_key options?
- Reject all malicious URL requests functions.php
- Passing in MySQL prepare statement parameter separately throwing error
- Load more posts using AJAX based on posts inside WP_Query
- admin panel – How to remove “delete” button from category editing page
- How to select post ID for given parent name with nested prepared queries?
- posts_per_page displays only 2 posts instead of 4 posts
- Get parent category name when only child category is applied to a product
- Add code to the header of posts by particular author
- Paged WP_Query is quitting on page 3
- Get Child of Child Pages in custom Menu
- Why does a header location on admin_head remove the query var I’m setting in the location?
- Help on Wp_query to print an term
- PHP drop down menu for my get_category child of
- Rearrange get_categories array compared to another array
- Remove the_content From Loop
- Pagination in category.php not functioning
- How to insert a variable into a query parameter?
- How to sort search result by post_title, then by post_content