Your array definitions aren’t correct. This…
elseif($_REQUEST["price"] == 20){$price = "array( '19', '20' )";}
… creates a literal string that reads “array( ’19’, ’20’ )”. Remove the quotes.
elseif($_REQUEST["price"] == 20){$price = array( '19', '20' );}
That should give you PHP arrays.
Related Posts:
- Is there a way to extend WP_query so Custom Post Types can have properties?
- Calling a wp_query $posts causes a 500 error
- How do you Query posts with nothing in common?
- Use post object from first query in second query
- Excluding pages in WP_query using ACF
- Assign custom parameter to each post in query
- Get specific value from variable to use in query
- My class function is not seeing GET url paramaters
- WP Query Args – Title or Meta Value
- WordPress Pagination Not Working – Always Showing First Pages Content
- Whats the difference between post_limits and pre_get_posts?
- Order Search Results Page by meta_value If no Value Return Remaining Results
- Query WooCommerce orders where meta data does not exist
- How to get Page/Post Gallery attachment images in order they are set in backend using WP_Query()?
- What exactly does the ‘s’ parameter search for in WP queries?
- get_posts not finding argument: post_name
- get query’s query string
- Show only oldest post by author
- assign 2 $args to one wp_query
- Revolution Slider Orderby Two Custom Fields
- Calling a custom excerpt function in a local loop
- Get random terms
- Dynamically Override Fancy Title – Part II
- Count posts returned by get_posts in external PHP script
- How to run query inside a class with namespace?
- Modify existing query and change order of posts
- Why does the_content not work like others for a set post id?
- How would I format a query that depends on post parent taxonomy
- Rewrite rule to prettify two $_GET variables while in a new endpoint from a page
- Creating a custom search for a specific post type
- How to add post_distinct filter to WP_Comment_Query?
- WP_Query Group by Author and Order each group DESC
- List only posts from specific category on category page
- Most popular post for last 7 days
- Order by slug in get_terms with multiple taxonomies
- Orderby ASC changes to DESC in WP_Query
- Is there any advantage of using default WordPress Search instead of creating a custom one?
- How to access WP database inside ipn.php? [duplicate]
- How to get only return parts of WP_Query result for performance?
- how to make members list directory through wordpress post custom meta key.
- Advanced ordering of query_posts
- How to get a query variable?
- Taxonomy and Date in same query?
- WP_Query returns posts_per_page + 1 every time
- Custom WP query with polylang term
- All posts returned when author of 0 is queried
- WP_Query – Accessing MetaValue from Query Result
- problems with comments_number()
- get_the_terms – but only show 4 Posts
- WP_Query object: what’s the difference between [query] and [query_vars]?
- Does WordPress have something like Drupal’s DB API?
- Hide products in uncategorized category from search results
- Is it possible to add relation between meta_query and tax_query?
- PHP – Loop custom post type categories within jQuery Tabs
- How order posts from category by date and comment count?
- Get a list of ACF Repeater-Fields as array
- Get query results with a page title
- Show single posts date, in a page of posts
- How to filter multiple queries with search?
- Compare “Main” post ID to ID inside wp_query loop
- WP_Query Class custom field parameters
- Attempt to display site authors in a carousel – User Image not Outputting inside li tags
- problem with the loop
- Order WP_Query by meta_key priority when ‘OR’ relation used for multiple meta values
- WP_Query for distinct meta values
- Group Product Types
- Facing problem with tax_query results
- Save queried result into database
- sanitize_post() is not sanitizing Post Object
- WP Query by variable custom field
- WP_Query multiple value not working
- Move some posts to end of sort order, even if there is a sort in the wp_Query already
- wp query search multi terms
- Translating WP query into to SQL query
- How to get top rated posts using wp query?
- Unusual high query of user meta data
- Woocommerce featured products query no longer working
- Tax_Query not working – connecting to second wordpress database
- How to search CPTs in draft using get_page_by_title()
- WP Query Meta Query
- Custom WP_query and integrating into theme file
- Empty ‘terms’ in ‘tax_query’ returns an empty array
- Archive – Show Page Month Headers
- Get newest value of an array
- Return a single custom post from multiple meta queries
- ordering and optimizing functions
- Why does order ASC break offset in WP_Query?
- new WP_query using custom fields
- Having Trouble Running Query From Shortcode Using Tribe’s Events Plugin
- Change ‘post_modify’ with a query
- query post based on comparison
- Dynamically create array from page title
- Ordering Custom WP_Query loop by meta key value with pagination
- wp_pagenavi on WP_Query using customfields
- paginate_links() on page (shortcode output)
- WordPress Query Returning Every Post
- shortcode with $atts with strange results
- How to get all post_id and meta_value using meta_key in wp_postmeta table
- List categories using WP_Query
- WP Query – Show custom posts only if user contain some user meta