In addition to the suggestion by @AhmedMahdi to solve your problem, here’s the narrower answer to your question: Nope, key
cannot be an array. As you can see in the specs of WP_Meta_Query key
must be a string.
Related Posts:
- Display products from specific category in shop page
- Exclude post on loop by multiple meta key value
- How to query ‘posts_per_page’ to display a different blog posts index template?
- Query sticky posts with thumbnails
- WP_Query on custom field and order results
- Any number in meta key (wp query)
- How to provide meta_key array to wp_query?
- Wp_query with 2 meta keys and array of meta values
- Meta query compare for ID’s greater than specific ID
- Use have_posts() with array of post results retrieved by $wpdb->get_results
- WP_Query not returning correct result with meta_query parameter
- show most viewed post
- Meta Query if Values Don’t Exist
- Custom loop – Isolating post meta output depending on current query taxonomy terms
- Get post count of current loop when using multiple queries on one page
- compare meta_query in get_posts arguments
- Changing the meta_query of the main query based on custom query_vars and using pre_get_posts
- Order by meta_value_num DESC and meta_value ASC on WP 4.0
- Query by meta_key and order by meta_value_num return orderby date
- Sort posts by custom taxonomy name
- Wp_query order by multiple custom fields?
- WordPress altering my custom query, How to fix it?
- Looping through tabular data
- Show default content if custom WP_Query has no posts
- Order by meta_key in custom post type doesn’t affect the query
- How to create/modfiy WP_Query to search in post title OR custom field?
- Display featured products through custom loop in WooCommerce 3 [closed]
- meta_query on a date range using an array of values
- Multiple WP_Query loops with Pagination Not Working
- Order Posts by meta value AND published date
- WooCommerce Only OnSale Products Loop Snippet [closed]
- Apply CSS class to every second database record [closed]
- How to prevent writing duplicate loops?
- ACF – Get lowest & highest value from field
- What format does the meta_query TIME type require?
- WP_Query filter and order by meta ordering by wrong joined table
- WP_Query last five posts, simply ordered by meta_value
- What is the random string I am seeing when I use get_query_var?
- WP_Query condition affects posts_per_page count
- 1/3 of posts different class
- Changing sort order for presentation by Jetpack infinite scroll
- get posts by meta_key from inside key of post meta
- Help optimizing slow WP_Query with meta_query
- meta_value_num not ordering all items
- Meta Queries – should nesting work after WP 4.1?
- Filter and Order by Multiple Custom Meta Values
- Meta Query relation “AND” then set array accordingly
- 2 weeks ago from meta query meta value
- Running main loop 2 times with conditional statement
- WordPress | Date not always appear [duplicate]
- Query with meta_query and tax_query together not working properly
- Ordering a mysql style datetime stamp with meta_query
- Best choice for multiple loop in page?
- WP Query – order posts by meta field first and then order the rest
- meta_query: check if number exists
- Event with multiple dates, display events chronologically
- How to create custom query by keyword in post title?
- Create a loop on my pages with new “WP_Query”
- WP ForLoop to compare meta information of posts to determine what post to display
- How to filter query loop block with a search string from the query parameters
- Different Loop for tag pages?
- WP Query / Meta Query [duplicate]
- Query posts by searching for a string in a meta field
- Search.php – return number of results but cannot loop through
- Creating ‘posts page’ loop based on the page itself
- How to add date_query to meta_query array
- Order by the first array within a meta_query
- Query ACF relationship field – Comparator IN – Value array
- Combine query in WP_User_Query()
- How to _GET multiple value checkbox WP_Query in Custom Toxonomy / Custom Fields
- How can I modify the query by adding to the existing query?
- Custom wp_query inside a conditional stament inside a template part doesn’t work: why?
- Duplice post with standard WP loop – fixed by using query_posts() instead
- WordPress Query custom ordering by temporary variable
- Check the stored / cached WP_Query with transients on post change
- New template file does not load category-specific post
- Comparing Meta Field date in WPQuery using Meta_Query?
- Get categories within specific term
- How to create better WP_Query to look for date time which is anywhere between two meta values?
- Query post with content only
- Filtering WP_Query based on wp_postmeta keys values
- Multiple meta_query not working
- compare for multiple meta values for same key in wp_query
- meta_query only check if both value are set
- Why is my query not giving results?
- Efficient way of querying for a “fallback” post?
- Continue loop after $queryObject
- Using custom field as ‘orderby’ value causing post grouping by publish date
- WP_Query for attachments without duplicating post_parent and displaying tagged image
- loop through custom post types with meta data
- Looking for a way to exclude frontpage and nav menu from query filter
- Using Query In Post Type Archives
- Creating Custom Query
- Multiple loops on index page with sticky post and pagination
- tax_query not working properly with get_posts
- the_excerpt() not working in custom archive
- Get posts by meta value except one post [closed]
- WP_Query by meta key not returning any posts
- How do I have multiple metaqueries inside one wordpress query
- Display only posts with thumbnails