‘meta_key=keyname’ must also be present in the query so I think you’d want
$args = array(
'meta_query' => array(
array(
'key' => 'wpcf-stream',
'value' => $_POST['category'],
'compare' => '='
)
),
'orderby' => 'meta_value',
'meta_key' => 'wpcf-stream',
'post_type' => 'half-day-course',
'posts_per_page' => 100,
'order' => 'ASC'
);
to display the rest of the posts I’d run a 2nd query and exclude the posts returned in the 1st query
Related Posts:
- Query WP REST API v2 by multiple meta keys
- Used with meta_query in query_posts works slowly
- failed to filter hook `get_terms_defaults`
- Get Posts updated or published within the last x hours
- Search a title word through query_posts (not the exact match)
- Excluding posts by meta, and also keeping posts without the meta
- Re-order search results with posts_orderby filter and post meta value
- query post based on comparison
- Filter posts by multiple checkbox categories
- Changing WooCommerce Display Price Based on User Role & Category [closed]
- How to add headers to outgoing email?
- LESS CSS enqueue_style with add_filter to change rel attribute
- Remove Editor From Homepage
- Remove description from on Home
- What do add_filters() and apply_filter() do?
- What to use instead of the content_save_pre filter?
- Moving sharedaddy buttons (in Jetpack) to the top of a post?
- How can I customize the wp_list_categories
- How can I reliably and globally disable wptexturize?
- filter the_title problem in nav
- Add classname to the_category() function?
- Filter the URL of next_posts_link & previous_posts_link
- Sensei LMS Hooks to Remove Content
- How to re-enable a filter after disabling with __return_false
- Ignore dots when searching in the media library?
- Using database meta_values to calculate new post order using pre_get_posts or a ‘request’ hook
- Exclude One Category and its Subcategories using WP_LIST_FILTER
- Explanation for remove_filter used in the below code [closed]
- Gutenberg disable the “block” tab in right sidebar
- Where is this inline CSS code [closed]
- When to use actions and when to use filters
- add_filter to ‘woocommerce_before_main_content’ [closed]
- Editing
- add_filter to apply_filters that exists within class
- Echoing Categories only if they’re a child of a given category
- Add ‘data-text’ attribute to TagCloud HTML
- Why in archive page doesn´t show read more button with excerpt?
- Removal of Jetpack OG Tags from old blog site
- Adding a title prefix with the the_title filter
- Don’t see add_filter result in the site front page
- How can I include an existing custom sitemaps listing in wp-sitemap.xml?
- Display Externally Retrieved Data within a Custom Template
- Can the wordpress color palettes by changed through Javascript?
- Filter on the_content doesn’t update the content being searched via register_rest_route
- Where to add_filter in theme functions.php?
- Cannot change the definition of AUTOMATIC_UPDATER_DISABLED
- How do I add a checkmark to my-sites save settings hook
- tag removed not using a filter
- WordPress Image update filter
- How to remove a plugin filter’s priority on specific loops (custom queries)?
- How to remove this filter?
- Trouble using remove_filter to override function in parent theme
- Load Posts’ individual body content on index starting at char 200 of each post
- Filter post query to only show direct children of category
- How to combine multiple body classes
- Querying multiple values from a single key
- Prepending character(s) to a custom tag title?
- How to make posts unqueryable/unpublish posts where ACF relationship field is an unpublished post? [closed]
- How to replace username with email address in users table
- Modify existing plugin function with add_filter
- include specific Pages to wp_list_pages with filter
- why require – does not load filter
- term_link filter rewrite link only applying half of condition?
- How can I filter tag_description()?
- Email Obfuscation: Is antispambot() Acceptable? [closed]
- an action hook when a post reaches a certain number of views
- WordPress overwrites UNC
- Need to return shortcode text instead of the output
- Change tags url to search different site
- How to optionally append components to the output of a gutenberg block?
- Dashboard filter based on custom fields URL response code
- Custom SQL query slows down when using multiple OR … LIKE … in posts_where filter
- Tax query get first product with attribute value in pre_get_posts
- I want to add string array to this function to filter displayed option in drpodown [closed]
- Drop down filter sort posts by latest, last 7 days and monthly
- Function not returning correct value for found_posts filter
- Unable to defer loading of jquery
- Remove style tags from head
- How to wrap pattern-matches from the_content in [wiki]-shortcode tags
- how to develop a filter in wordpress to let the user filter the page content depends on the date (newest to oldest etc…)?
- Print only parent categories of post in custom RSS feed
- Login logout below menu bar
- Use add_filter inside another function
- Add HTML to the bottom of each post in a post list
- How to filter reading/visibility posts based on role?
- Admin view: filter posts by whether they have specific taxonomy attached
- Filter posts by categories ajax is showing all the posts
- URL to filter posts by post meta similar to shop/?product_cat=”painting”
- Ordering Posts By Meta Data
- Incrementing content with extra text after save/publish
- Conditionally (cpt) filter previous and next_post_link
- changing size image within the content
- Remove action added from class
- Identify admin/logout and more filters
- Sanitizing a custom query’s clauses
- How can I display wp_link_pages before a shortcode, if it is used, or display after content?
- How to create a list of terms who’s posts also have a predefined external term?
- Better way to change the default password reset url with the woocommerce one?
- woocommerce_coupon_is_valid_for_product not working to exclude specific product tag
- How can I conditionally add the filter option_home?