args = array(
'post_type' => 'product',
'meta_query' => array(
array(
'key' => 'brand',
'value' => 'crocs',
'compare' => 'LIKE'
)
)
);
$query = new WP_Query( $args );
Related Posts:
- Order posts by custom field and if custom field is empty return remaining posts
- Custom query with orderby meta_value of custom field
- Query Posts or Get Posts by custom fields, possible?
- query_posts and only show results if a custom field is not empty
- Filter archive.php by custom meta
- Calling Specific Pages with wp query Part II
- Loop through two different sets of custom fields
- Query on custom field count?
- How to use query_posts() with a date filter on a custom field?
- meta_value_num sort glitch
- Can ordering post list by meta_value cause performance issue?
- Order by value in serialized custom field
- Author Page Custom Query WHERE author OR [post meta value] OR [post meta value]
- How do I query for a post by custom field?
- meta query not showing any results?
- How do I exclude posts by custom field value?
- Echo values from custom field outside loop php
- Upcoming Event: How do I sort database by custom date field, but ignore past dates?
- Calling custom fields for pages (not posts)
- Duplicate posts being displayed when querying Custom Fields
- how can i use custom field in query post
- How to insert content from another Custom Post type into Post?
- using multiple meta_key and meta_value in query_posts
- Query post order by post and desc not working
- How can I sort homepage by a meta value?
- Loop to display random posts only if a custom field matches category
- Order query by meta_value with multiple custom fields
- How can I show custom fields in the loop only to specific user roles?
- get_posts that match a user-specified value on a page
- Accessing loop functions (e.g the_title or the_content) from post ID
- Show 1 post and after a specific date show the next one
- How to select posts from multiple categories and metavalues?
- meta_compare seems to be treating values as strings instead of integers as expected
- Limit the number of acf content when displaying in post loop [closed]
- Is there a better way to list all database terms alphabetically?
- Change the main loop WordPress impact on the server?
- custom-meta-box checkboxes from loop won’t save
- How to show a post if was published less than two hours ago?
- List users by sum of all their posts’ custom field values
- Change order of posts
- filter custom field values $min $max
- Custom Fields – How to create a list from multi-line entries of a single value
- query posts custom field calculation value
- WP Query – Is this correct?
- how to make nsfw post with thumbanil
- Custom Query based on custom field of a single post
- Efficiently sort only certain categories by custom field
- Query_posts with custom field meta value
- Can I access a post meta field before the loop?
- Displaying page image in the footer automatically
- Unable to get specific value from post meta
- Show image if author meta (profile fields) exists outside loop
- Can’t query by meta_key
- Conditional operator OR not working with custom fields
- Meta_query ‘compare’ => ‘LIKE’ not working?
- ul list with only as many li’s as filled custom fields
- Loop through custom taxanomy in post and display custom fields from posts
- Loop through incrementing custom fields
- query_posts with meta_value
- Custom search SQL Query to add custom field in result
- How to put forward a blog post
- do_shortcode close
- Search Results Page – Displaying Custom Meta Fields
- How can I change the publish date based on a custom field?
- Interrogate a page within a loop to check template type or custom meta data (Pages vs Posts)
- Collect Data from NEXT item while in loop
- How to show content of custom fields in search results?
- Custom field outside the loop and inside an array
- Display metabox title for custom fields with values
- Get author total post votes from post meta
- use custom field value as post category in loop
- Problem with writting correctly a query posts args in WordPress
- Filter or order based on custom field
- simple fields plugin custom query
- Compare ACF date field (if exists) and post date and order DESC
- What am I missing in this Code Block?
- get_field values for each post on home page using wp_add_inline_style
- Problem with my loops
- User Filter Options on Archive Page
- Custom meta boxes – add php code inside?
- query_posts -> get page_id from custom field
- get wordpress post loop by meta box date
- Outputting custom field on home.php not outside of blog list
- Counting number of images from loop
- Metabox value for post loop?
- Get meta value when the page is a blog archive
- WP_query returns error when used for custom widget
- Checking if field is set before comparing with meta_query in query_posts?
- I want my post to republish again after adding a custom field
- Display posts where date field matches current month?
- Retrieve IDs from custom field, count and display results differently according to count
- Display agents (custom post type) alphabetically, except one who always shows last
- Pagination not displaying correct number of pages
- Display custom field outside the loop
- Filter Query Post by Custom Fields(by date)
- Custom field not showing
- Order by a meta field in query loop
- searching in custom meta field
- Custom contact form 7 select with custom values [closed]
- Show a Category X’s custom post type on Category X archive page?