have a look at WP_Query(); and use meta_query / tax_query arguments
$args = array(
'post_type' => 'product',
'meta_query' => array(
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:
- Filter results with custom field values and dropdown
- Is there a way to do multiple ordering on a multiple meta_query?
- sort search results by custom fields using dropdown
- query usermeta from custom field
- How to query an out put value?
- Custom search SQL Query to add custom field in result
- How to exclude custom fields from search queries?
- Search & column order by meta value in admin
- searching by keywords in post’s metas or pagination links problem
- Create custom query for search?
- How to add a prefix to existing custom fields over MYSQL query?
- How to display search query as formatted text?
- Using meta query (‘meta_query’) with a search query (‘s’)
- Validating Custom Meta Box Values & Required Fields
- Is there a way to set default custom fields when creating a post?
- How to rename a custom field?
- How can I make wp-pagenavi work on a custom query built upon a form submission? [closed]
- Custom search: by post data and post metadata?
- Need small coding with Custom Fields Search
- Search ONLY by meta key / meta values
- Edit Custom Database Tables in WordPress
- Meta keywords and descriptions plugin for manually editing meta for each page/post
- Making a configurable field translatable
- How to customize default wordpress editor?
- WordPress Search Custom Meta Field Only
- How to make custom comment fields required and message field not required
- Problem in custom meta boxes
- Multiplile values checkbox or select in custom meta box
- how to save multiple custom fields for a post in one go?
- Plugin similar to Taxonomy Drill-Down for custom fields?
- Extend ‘The Events Calendar’ search to include custom fields [closed]
- Include woocommerce custom field value in front-end search result
- Count how many posts have a custom field set
- How do you create dynamic customised sections in WordPress?
- Using a checklist to search against metadata
- Loop to display random posts only if a custom field matches category
- Custom Fields Not in Search Results
- Custom Field Create Bulk via SQL Query
- Create Pop-Up Box with Custom Field Content Inside the Loop
- filtering custom post types via meta data drop down
- Displaying a checkbox array from advanced custom field
- How to select posts from multiple categories and metavalues?
- Sort custom field by post
- Is there any way to get all meta and standard columns for any WordPress object after searching based on meta key and value
- Order RSS content by an advanced custom field value
- Advanced search by two criteria – sort by location and date (ascending or descending)
- How do I have WP_Query match posts based on search parameter OR meta fields? (rather than search parameters AND meta fields)?
- Alter main archive, to show posts with meta as last
- How do i add custom fields to my themes template file?
- Custom tables or custom fields?
- Post selector as Custom Field
- Trying to reorder posts by custom field
- Limits, not all post are showen when querying for posts by view count
- Get post ids sorted by meta_key
- querying a custom field
- Custom Loop Query For Search Page
- pre_get_posts : only get posts by wp_usermeta value
- How to remove custom fields from the selector?
- Query post by date (stored custom field meta as yyyymmdd) and differentiate across 12 months
- Let’s Create Custom Field Template Documentation
- How can I combine this php statement to get the results of multiple variable inputs?
- List custom queried terms in the edit-tags.php?taxonomy page
- Modify date query by URL parameter using pre_get_posts and $_GET
- MetaBox not saving after empty
- Loop through incrementing custom fields
- Showing Custom Fields on Parent Page
- Custom Same Page Search
- Custom meta boxes not saving
- The best way to collision check in WP
- Best way to achieve multiple links in a post title
- WP_Query () using taxonomy, custom post types
- How to query for posts with either one or another custom field
- Best way to sort estates and query them (for rent? yes/no. contains office space? yes/no)?
- Get array of posts based on custom field values
- Save custom field types with this function…?
- Custom Field Date Problem
- Approach to creating a site with this structure
- Need to search a custom field (ingredients, one long string per post), but want it to allow phrases/non-exact matches
- Compare ACF date field (if exists) and post date and order DESC
- Dynamically populate query source in Elementor post widget
- search based on custom field
- Add to search posts query array with post IDS which will appear first
- Save input form on custom field
- Admin – Search Events by a custom field
- Is it possible in WordPress
- Extend WP_Customize_Control with Multiple Field Control
- Custom fields are not displaying in page with multiple loops
- Search a meta field for a value in all posts
- How can I create more “create attachment” custom field – any idea?
- query specific posts according their custom fields, using sql SELECT
- Meta_query not filtering posts
- Get multiple posts with some custom fields efficient
- Complex WP_Query Using Post Date And Post Meta
- Custom search with meta fields
- Semi-Private Comments + page comments -> is it possible?
- How I can change PayPal IPN ‘custom’ field in woocommerce?
- Google not index my Custom 404 page ?why?
- Add fields to edit in custom widget
- Can I log the searches that are returning 404 in the DB?
- Search for meta_query does not return any result if combined with title