I think you don’t have to use meta_query.
Simply use the code like shown below:
$args = array(
'post_type' => 'property',
'meta_key' => 'rental_type',
'meta_value' => 'Vacation'
'posts_per_page' => $properties_per_page,
'paged' => $paged
);
Also you got to get the value of $properties_per_page before this query.
Related Posts:
- Meta Query with AND & OR?
- Alter main archive, to show posts with meta as last
- Query post by date (stored custom field meta as yyyymmdd) and differentiate across 12 months
- Best way to sort estates and query them (for rent? yes/no. contains office space? yes/no)?
- Create custom query for search?
- Using meta query (‘meta_query’) with a search query (‘s’)
- ORDER BY custom field value
- Can I query custom meta data through WP_Query
- Add custom fields to search
- SELECT max(meta_value) FROM wp_postmeta WHERE meta_key=’price’… stops working when value is over 999
- How to rename a custom field?
- Matching Serialized Arrays with meta_query
- How can I make wp-pagenavi work on a custom query built upon a form submission? [closed]
- Trying to perform complex custom field query with order by set to field value
- Is there a way to do multiple ordering on a multiple meta_query?
- WordPress Search Custom Meta Field Only
- Compare meta_query decimals not working right
- Ordering posts by anniversary using only day and month
- Calling Specific Pages with wp query Part II
- Loop through two different sets of custom fields
- Comparing timestamps in meta query doesn’t work
- Display two post types ordered by two custom fields
- Slow meta query with multi meta keys
- Using OR in WP_Query negates the “NOT EXISTS” compare
- How can I query on the year part of a complete date in a custom field?
- How can I combine meta_query queries?
- Displaying posts with only upcoming dates according their custom field date value
- Difference between ‘LIKE’ and ‘IN’ in meta queries
- Plugin similar to Taxonomy Drill-Down for custom fields?
- Sorting posts by multiple values, combined
- meta_value_num sort glitch
- WP_Query display next custom post from today’s date
- Which is best in the following scenario : post_meta vs custom table vs parent/child posts
- WP_Meta_Query causing long-running MySQL queries
- How do I query for a post by custom field?
- Sorting posts by custom fields in meta_query
- Count how many posts have a custom field set
- meta_query for a string inside a meta field containing a comma-separated list
- Order by custom field value not working for acf date field
- Upcoming Event: How do I sort database by custom date field, but ignore past dates?
- sort search results by custom fields using dropdown
- Complex WP_User_Query call fails on production server
- How can I sort homepage by a meta value?
- Loop to display random posts only if a custom field matches category
- $wpdb query a post type within a specific taxonomy term while ordering posts by custom meta value?
- Meta query with timestamp using WP_query
- Orderby custom field meta value ASC and then by date DESC
- Conditional custom field query
- Display only past events on that page using Visual Composer Grid Bulider
- Custom Field Create Bulk via SQL Query
- Create Pop-Up Box with Custom Field Content Inside the Loop
- How make a custom search on backend in WordPress without plugin?
- How to add a new meta key and assign timestamp to posts
- Get content from pages with same meta_key from Database
- query usermeta from custom field
- WP 3.1 meta_query for multiple custom field values
- 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
- How do I have WP_Query match posts based on search parameter OR meta fields? (rather than search parameters AND meta fields)?
- Get posts with same meta value as current post
- Meta Query returns wrong number of posts
- Change order of posts
- Meta Query And/Or
- Trying to reorder posts by custom field
- Use meta_query to get title of associated post
- Limits, not all post are showen when querying for posts by view count
- Meta query with multiple custom fields for archives page ordering problem
- Why orderbyb meta_value_num won’t affect the generated SQL Query order?
- filter custom field values $min $max
- Ordering posts by custom field named “date” in backend
- Get Data From wp_sitemeta for Multisite network
- Unique meta_key with array value vs repeated meta_key with single values
- get posts where a custom field contains a text
- WP Query – Is this correct?
- Get post ids sorted by meta_key
- How can I do a variable for meta_query?
- querying a custom field
- Avoiding ACF get_field and returning to core WordPress function
- pre_get_posts : only get posts by wp_usermeta value
- ORDER BY custom field value out of where clause
- comment meta_query for keys that aren’t yet set
- How to query an out put value?
- List custom queried terms in the edit-tags.php?taxonomy page
- ACF: How to get users with a ACF flexible content subfield with a specific value AND layout?
- Custom Query: If One Post Object Field Value Is The Same As Another
- change order of images attached to post
- Meta_query ‘compare’ => ‘LIKE’ not working?
- Diamond question mark in text after migrating content
- Modify date query by URL parameter using pre_get_posts and $_GET
- Loop through incrementing custom fields
- Custom search SQL Query to add custom field in result
- tax query between operator like
- The best way to collision check in WP
- How to exclude custom fields from search queries?
- WP_Query () using taxonomy, custom post types
- How to query for posts with either one or another custom field
- Custom Query: query by post custom meta data
- Get array of posts based on custom field values
- Is it possible to compare the current time with a custom “start” and “end date
- Searching with Multiple (Parallel) Criteria on Custom Fields?