By adding another array
$args = array(
'post_type' => 'custom_post_type',
'meta_query' => array(
array(
'key' => 'size',
'value' => 'big',
'compare' => 'LIKE',
),
array(
'key' => 'gender',
'value' => 'male',
),
)
);
$query = new WP_Query( $args );
Related Posts:
- author.php with ACF and CPTs
- Query to return maximum of one post per author
- Show only oldest post by author
- Function to check if author has posted within the last x days
- Show one post per author and limit query to 8 posts
- Pagination 404 errors for author posts query on author.php
- Only display authors who have posts
- Get List of all the Authors
- How can I display list of all posts from a specific author, with publish dates in the future, on an author archive page (author.php)?
- Get authors by term id or slug
- Dynamic User Id
- slow WP_Query for non-admin user
- WP_Query (list) posts according to author’s custom field
- Exclude some authors from query
- Get author if post has multiple authors
- All posts returned when author of 0 is queried
- Posts in loop all show the same author when there are many authors
- Stomping WP_Query in author archive to facilitate pagination with custom queries
- Display if author page is author page of current user
- Exclude authors IDs from WP_Query
- WP_Query author parameter not working
- query post by author gender
- How can i show pagenavi in my author.php?
- wp query to use both author id and meta_query
- Counting instances of words in the results of a post query
- Query posts by post type, author and post meta
- Get authors list and sort them by recent posts
- query all posts published by certain user id
- WP Query get posts by specific author IDs if one of several logged in authors
- Page template query with WP_Query
- How to display page content in a page template?
- get_queried_object() returns null on post date archive
- Display List Of Posts Containing a Relationship Field Value [ACF]
- How to clear the cache?
- What to do in this case after wp_query has been modified
- How-to exclude terms from the main query the most performant way?
- Pagination with WP_Query is buggy – working for some pages, but not the others
- Exclude comments from a WP_Query object?
- Get the number of posts from the current page results
- How to get random posts and order them by date
- Why is my WP_Query not working when tax_query terms are an array?
- Make First post different from rest?
- Get WooCommerce best selling products for the current month [closed]
- When should you use wp_reset_postdata vs wp_reset_query?
- How to count post meta key values for all posts in database
- Custom search form with empty parameters
- Post queries by latitude and longitude
- WP API to fetch all the media/posts records if count is more than 100
- How to disable the editing of the time and date published?
- How to use global post counter in the loop?
- WP Meta Query for some meta (array) values
- Injecting content with $wp_query->current_post restarts from zero on paged pages. How to inject content after X posts, regardless of pagination?
- Find all product that contain terms with %keywords% in WP_Query
- Front End Sorting Questions
- How to target the default Recent Posts and Recent Comments widgets with pre_get_posts?
- Filtering WP_Query result by category
- posts order by title second word
- Merged two WP_Queries, posts per page and pagination not working
- Why WP_Query::is_date() returns false when ‘date_query’ argument is set?
- Meta_query with or without value
- How can I query posts from multiple roles?
- WP_Query Filtred by author name ( Return null )
- How to add terms to my tax_query based off of the current post
- Query all posts in a given taxonomy
- How To Get Some Data From WordPress Database Using WordPress $wpdb Query?
- Using $paged redirects /page/2 to page 1
- Why wont this wp_query exclude certain pages?
- Create ONE callback for all page templates, post filter queries + paginated pages, triggering pagination via AJAX
- How do I change database charset when using `wpdb`
- WP_Query attachments by multiple IDs
- get_posts – get all posts by array of author
- wp_query not searching with apostrophe
- pre_get_posts Remove tax_query Completely
- Query “Category A” + 1 post from “Category B” – how?
- Unexpected end of file
- WP_Query To call data from diffrent tables
- new WP_Query with author argument return no results
- How to combine two or more WP_Query?
- Assigning a meta_query value based on regexp to wp_query fails
- Getting Taxonomy inside WP_Query Loop
- Nested tax_query that allows specified categories OR tags, but NOT other categories
- How to delete taxonomy term when a wordpress user is removed?
- Custom query based on meta key – Reduce three states to two in results?
- Clean up WordPress code that repeats
- WP_Query custom query showing only 10 posts on all pages
- Not getting metavalue
- Ajax load more posts – WP_Query parameters not working
- Display Featured Post by Categories and Avoid duplicated posts
- How to display multiple custom fields with the same meta_key in an ascending order?
- Using the_post_thumbnail resets current loop item ID
- Meta_query with multiple keys and multiple values
- WordPress WP_Query make mysql time out
- How to show optimized list of posts with all their attachment images
- Posts not showing per category after WP_Query?
- wp_query exclude word and category
- Assign Json file to WP_Query
- How do I exclude the lowest level terms in a taxonomy?
- How can I query users by custom role?
- How do I query for posts by partial meta key?
- Post loop for all taxonomy terms