I think that what you’re looking for is this:
<?php
$tours = new WP_Query(array(
'post_type' => 'tour',
'posts_per_page'=> 12,
'meta_key' => 'tour_price',
'orderby' => 'meta_value_num',
'order' => 'ASC'
));
Descending means going down, as in, high to low.
Ascending is going up, low to high.
Related Posts:
- Meta_query compare operator explanation
- Nested meta_query with multiple relation keys
- meta_query ‘compare’ => ‘IN’ not working
- Sorting: custom query with orderby meta_value_num THEN by title
- WP_Query with checkbox meta_query
- Add indexing to meta_value in wp_postmeta
- Custom WP_Query order by post_meta and (author) user_meta
- Query Multiple Post types each with own meta query
- Perform query with meta_value date
- Meta Query with date and time on the same Day before given time
- How to grab metabox value in wp_query meta_query key
- datetime picker, timestamps and meta queries
- Compare two meta-fields in a wp_query (where meta-field-A is larger than meta-field-B)
- How can I create a WP_Query that returns posts where one meta_value
- Meta Query querrying several post types based on ACF fields is broken after update to WP 4.1
- Querying by taxonomy vs Querying by Custom fields Speed Comparison
- How to get sum of meta_values of a meta_key in wp_query according to conditions
- How to count data records in wordpress which have same meta_value in wp_postmeta table?
- WP Query – Get WooCommerce Products with variation that is in stock
- meta_key and meta_value not working together
- Order WP Query posts by custom order calculated from post meta values
- how to speed up a complex wp_query?
- How to query for custom field within Gutenberg block from outside of that post? [closed]
- Meta Query for specific months
- Meta query with JSON value
- Get meta info related to current post
- Creating arguments from loop for WP_Query meta_query
- Add condition of user capability in WP_query
- ACF Date Based wp_query
- How to make Meta Query case sensitive?
- Performance when getting post meta for post retrieved by meta value
- Get attachment by meta_key value
- Any number in meta key (wp query)
- Using meta_query with multiple keys and compare values
- Mysql query and order meta value
- Is it a good idea to improve meta query performance by adding tax query?
- meta_query BETWEEN, but the range is stored in the custom field
- Is it possible to set specific posts to show first in a query?
- Modify wp-query and sort by post meta key
- Tax query AND/OR meta query [duplicate]
- Orderby listing issue
- Help ordering Post loop by two meta values
- database query with more than a couple meta hangs and doesn’t complete
- Make meta query treat meta_value as 1 or 0
- WP Query Meta Value – How To Identify Specific, Unique Values?
- Order by meta_key doesn’t work
- Sort by presence of thumbnail
- it’s possible make a WP_Query with math operations?
- Multiple meta_key ordering with pre_get_posts
- Sorting search results with custom dropdown
- Get meta_value of a specific meta_key from all posts belonging to a specific custom type
- Custom query filter by ACF date custom field
- Nested array issue in meta_query
- Error in meta_query not get result
- Meta query with compare by more than 2 fields
- WP_Query meta compare must include ALL array values
- meta_query returning excluded result
- What’s missing in this wp_query and meta_query
- meta_query weird behaviour, static int will work, but not user data
- Creating a query that get all posts but places meta items first
- ACF: How to query for a given value count of an array like field? (e.g.: How many rows has a `flexible_content` field?)
- get_posts query is taking about 40 seconds to execute
- wp query to use both author id and meta_query
- meta_query – check for multiple meta values in key which holds an array of values
- WP_Query for a taxonomy value OR a custom post type meta field
- Trouble with serialized metadata
- meta_query order by date present -> future then show null
- Searching for a specific month in a metadata saved as Timestamp (Wp_Query)
- Meta query orderby meta_value_num sorting by role first
- WP_Query on custom key and value
- Sorting with meta_query and multiple, optional meta keys
- meta_query compare > not working
- Query by meta value (add a dropdown of all values)
- meta_query is not allowing to show posts when querying multiple arguments in a WP_Query
- Speed up WP_query with meta comparing dates
- Meta Query if Values Don’t Exist
- Saving custom fields for WP_Query to retrieve
- How to show all the associated posts with specific date of data metabox?
- Is it possible to search for a string in posts OR postmeta?
- Filter posts/pages by user_role array
- WP_Query with MetaQuery issue
- WP_Query Posts by Metadata from Option Tree
- Custom loop – Isolating post meta output depending on current query taxonomy terms
- WordPress meta_query not working
- Using orderby with 2 meta keys
- WP_Query with meta_value_num and meta_query not paged correctly
- Post Query not working after updating to 4.1
- Orderby Meta Value and Query from Meta Query
- The sorting of posts by a meta_query with two keys fails while separated as single queries it works
- Sort posts in dashboard using custom field; also include posts where field isn’t set
- Sort Posts with custom meta key by default which is currently set as optional
- Why is WP_Query’s meta_query not filtering results?
- WP_Query with several meta_query-statements and order by meta_value
- meta_query in wp_query not working as expected
- Using ‘meta_query’ with the ‘pre_get_posts()’ hook disables searching for post titles
- How do I have multiple metaqueries inside one wordpress query
- WP query with multiple custom meta not respecting orderby
- Display only posts with thumbnails
- Passing a variable containing a comma separated list of values in a meta-query
- How to use meta_query to retrieve posts from multiple custom post type