You were on the right track: use a meta_query in your query.
There are plenty of examples in the codex, how you implement it depends on what fields you’re using, but that’s the way to go. An example with multiple fields queried:
$args = array(
'post_type' => 'product',
'meta_query' => array(
'relation' => 'OR',
array(
'key' => 'color',
'value' => 'blue',
'compare' => 'NOT LIKE',
),
array(
'key' => 'price',
'value' => array( 20, 100 ),
'type' => 'numeric',
'compare' => 'BETWEEN',
),
),
);
$query = new WP_Query( $args );
Related Posts:
- Free or affordable OCR and ICR (handwriting recognition) SDK?
- What characters are allowed in an email address?
- What is an easy way to display a front-end user registration form?
- How to get current url in contact form 7
- How to pass on Google Adwords gclid variable to other pages
- Best way to create multi-step form with data saved to user account for later updating?
- Custom Registration Template/Page
- show image in mail contact form 7 [closed]
- need to add attach thumbnail from my form
- Checkbox won’t check when label is clicked
- Nonce actions and names available via open source
- Duplicating/Cloning Multiple Form Fields
- Performing a POST action on homepage goes to posts page
- Add contact form
- 404 on form submit [duplicate]
- Form Processing
- Reset recaptcha contact form 7 [closed]
- Saving checkbox/option list status?
- Customize reset password form redirect problem
- creating form for wp_remote_post
- How to know what submit button the user clicked?
- Creating a custom multilingual form
- How to use TinyMCE in the quick edit form?
- How do I use the info submitted in a form to create a form reception page? (like “thank you {firstName}”) [closed]
- How to retrieve form data?
- Can you disable the mail function in contact form 7 [closed]
- Embed interactive pdf
- Grab values from the query string to fill in hidden fields in ninja forms [closed]
- Make editor required for post from frontend
- placeholder text in category form label
- nonce in custom form is not verifying
- Use $_POST data in functions.php
- WordPress tabindex Order
- PHP form is not sending mail if I use mime type and version in header. How to solve this? [closed]
- Custom form in admin area, redirect in wrong page
- Is there a WordPress form plugin that can easily be configured for Google Analytics goals?
- Form submission in WordPress front end
- How to code auto-retry for API call
- How to check form input against PHP variable?
- Show button once Contact form 7 is submitted
- How to validate my form
- how to insert textbox value in existing database table in wordpress?
- How to move HTML form to WP Theme
- Is there a reset_button()?
- How can I modify labels in default wordpress registration form? [duplicate]
- Display number of sign-ups [closed]
- Contact form submit, having to click twice
- Is it possible to pass variables to WordPress externally?
- Form within thickbox
- Front end post form validation
- How to take large file uploads from users the right way
- Dashboard Contact Form
- gravityform – retrieve multiple check answers “keys” instead of “values”
- Exporting a form to a CSV file does not work in WordPress but it does in PHP
- How to redirect with success message in wordpress admin panel?
- WordPress – Users with contact form on profile
- How to stop iFrame form from reloading on mobile?
- using esc_html_e string in custom form using code snippets
- I’m needing to figure out how to create a page that user could create a “task” and it be selectable on a form
- contact form and WP loop
- AMP and Paypal form CORS issue
- How to create a custom range slider in wordpress form?
- Quickly Maintain/edit 100+ WordPress Forms on multiple websites
- Timezone dropdown in form
- Prevent malicious scripts to be submitted in post
- Unexpected token admin.php
- display a message if get form is empty
- Adding a different domain to existing WordPress site
- .html form added to a page
- Sending email via function in page or setting up the action properly in another page
- Multiple Taxonomy post query with exclusion
- How do i can data from my custom form to a custom table
- Form Sanitization and Validation
- Remove active cursor from form field
- import excel form into wordpress
- Custom forms + Polylang
- What is the proper way to embed the HTML of an external form such as payflowlink from paypal?
- How to make caption field required in media library?
- Displaying errors on the front end from my plugin
- How to creat form with get method and receive it
- Username from e-mail
- Custom Contact Form Not Sending (but not giving error)
- Assigning input to variable
- Send message to author without showing email address [duplicate]
- Custom form on front page redirects on error page
- IE 9 Clears Form Fields
- Form validation on user profile edit
- custom form submission
- How to get formidable entry ID by post ID? [closed]
- Using form method in a template WordPress page
- Calling custom PHP from a HTML form post action gives 404 error
- Reset form on onclick function
- How to add a checkbox with categories of entries to the form Contact Form 7 WordPress
- Conditional Logic for the Input Mask in Caldera Forms [closed]
- Form that stores emails [closed]
- Adding Mailchimp API key dynamically
- WordPress – custom user flow registration approval
- Gravity form with paypal adon should return custom receipt
- I cannot enter the letter C in the form [closed]
- Add options to WordPress Blocks form dropdown field