Need to check if user has completed a woo commerce payment
Need to check if user has completed a woo commerce payment
Need to check if user has completed a woo commerce payment
You forgot to use relation in meta_query . I think this will work: $args = array( ‘post_type’ => ‘brewery’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => -1, ‘meta_query’ => array( ‘relation’ => ‘AND’, ‘review_rating_meta’ => array( ‘key’ => ‘review_rating’, ), ‘reveiw_count_meta’ => array( ‘key’ => ‘reveiw_count’, ), ), ‘orderby’ => array( ‘review_rating_meta’ => ‘DESC’, ‘reveiw_count_meta’ => ‘DESC’, … Read more
How to order query results based on if a custom field has been populated, then the order by the date of the post?
Order WP_Query by meta_key priority when ‘OR’ relation used for multiple meta values
You can use get_posts() for both event types and merge them. $merged_events = array(); $upcoming = get_posts(array( /* Your upcoming events args here. */ )); $past = get_posts(array( /* Your past events args here. */ )); $merged_events = array_merge( $upcoming, $past); foreach( $merged_events as $merged_event ) { //Your loop }
How to add date_query to meta_query array
A More Efficient Count When querying for a count without interest in the actual content of a post, WordPress provides a found_posts property on the query containing the total number of matches – so you needn’t load every post from the database; you can query for a single post and still retrieve the total count. … Read more
How can I query for posts using a date stored in post-meta?
I’m not familiar with the Meta Box plugin or it’s capabilities (and please note that third-party products are considered off-topic here!) – but regarding the question in the scope of core WordPress alone… For clarity’s sake, I envision the lessons_teacher meta-value to look similar to [[‘post_name’ => ‘john_smith’], [‘post_name’ => ‘jane_doe’]] SQL – and by … Read more
Query multiple post types, but different order for each