You can do it with WP_Query:-
$query = new WP_Query( array ( 'post_type' => 'product', 'orderby' => 'meta_value', 'meta_key' => 'price' ) );
Replace ‘price’ with your meta key.
Reference:-
http://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters
Related Posts:
- List upcoming events, ordered by date in a custom field
- Display custom post types with custom date field value (before today) & order by custom date field
- Rewrite and custom post type: order by custom field not working
- Order Custom Post Type by Custom Field Value
- Add a custom meta box for client to order CPT posts how they want
- Having Issue on Ordering CPT by Custom Field In Custom WP Query
- Filtered by a custom field, ordered by another
- Orderby if between two meta fields
- What’s the most efficient way to get two queries based on an if statement?
- Show first posts with custom field not empty and order all by title
- How to display custom post type ordered by a custom field date
- 404 on Pages for Custom Post Type & Query_Posts
- Custom Post Type Data in Sidebar widgets?
- Order by & include array by specific post ids
- Hide custom post type field from author?
- Many to Many Relationship between Two Custom Post Types
- Sorting a query by custom field date
- echo value from ‘select’ field type into page template using cmb2?
- wordpress plugin error handling
- Creating Photo Gallery System with Custom Post Type
- Set post title from two meta fields
- WP_Query -> sort results by relevance (= most tags / taxonomy terms in common)
- How to sort CPT by custom meta value (date), and return posts month by month
- Trying to save custom post type from frontend partially working
- Custom Taxonomy order by Custom Field
- Comparing timestamps in meta query doesn’t work
- Is there any performance consideration when using Custom Post Types?
- How to query different post types in specific order?
- Custom Post Type Navigation on Custom Field
- how to interconnect custom post types?
- WP All Import – Using Xpath to set a select value
- Adding dropdown select meta box to custom post type – seems restAPI is interfering
- Show listings from Impress Listing plugin in random order using taxonomy and terms
- Automatically update custom field in all posts of a custom post type
- Wp_query: sort by PHP variable
- Allow user to set custom order to a list of custom taxonomies?
- Filter custom posts using auto populated dropdown selectors
- Add custom field to Posts and sort by it
- Two Custom Post Types Many to Many Relationship
- Including metaboxes from custom post types in global search — continued
- Show image gallery from a custom field
- Using advanced custom fields from one custom post type in another custom post type / using nested shortcodes
- filter custom post in rest api with custom function
- Custom Fields for Custom Post [closed]
- Is there any way to add a “custom field” to the CPT archive page?
- Ordering custom post type by multiple custom fields
- Order by custom field meta_key date and then by custom file meta_key number
- don’t publish custom post type post if a meta data field isn’t valid
- WebP Fallback for Inline Background Image in Style Attribute
- How can meta boxes be added to “unknown” custom posts?
- Custom “radio button meta box” not saving correctly
- Check if post with same meta value exists
- Custom posts type for individual pages?
- custom post data – how to
- Custom Post Type Metadata Not Saving
- Editor / Add Media: Is it possible to only allow galleries?
- What do the numbers mean at the end of add_action(‘save_post’)…?
- A meta box (in a custom post type) with two different type of fields
- copy images from custom field to another custom field
- How to migrate Custom Field Template to a WordPress Multisite
- Sum and count of custom field values
- Cannot obtain custom meta information
- How to use a specific custom field in a custom post type as slug
- How do I show my containing my custom field ONLY if there is a set value on that custom field? [closed]
- How to hide a custom field from admin?
- Adding an extra parameter [string] to my posts’ permalink?
- Add Extra Category Field to CPT Categories
- Empty meta-box returns publishdate if no value is set?
- Custom Post Type Meta Box Text Input Field Won’t Save When Blank
- Alike Shortcode using in Custom Shortcode
- How can I sort the results of a REST API response by the title of a connected custom post type?
- Why this didn’t work if i use get_the_ID(), but works if i pass the numeric id
- What is the correct way that when creating a custom post type assign values to custom fields created with pods framework?
- Custom Metabox Info Not Saving
- Post Filtered by Custom Field Value
- Autofill advanced custom field with user data
- Advanced search form with multiple custom fields
- Multi Photo Upload with Caption on Front End for Custom Post Type
- Search facility with directories
- How to make a shortcode for my WP_Query Loop? [duplicate]
- Query events post type after current date and timezone
- Avoid another meta box in my custom post type
- Can’t pick up a field created with Advanced Custom Fields
- Pre_get_posts comparison with custom field doesn’t work
- Orderby modified only for specific post types
- shortcode order for event custom post type
- Post content is cleared when updating
- Unable to get the upcoming events for custom post
- Custom field totals
- Repeatable custom meta select boxes
- How to show animal lineage/pedigree in WordPress?
- WP_Query arguments: Loop through custom post type – get all entries except excluded meta_key?
- Types plugin isn’t compatible with my custom post type
- Order custom post type is beign ignored
- Show Posts in Vertical Tabs with Scrollbar
- How do I filter a custom post type loop by a field?
- How to order different custom post type in category or tag template page?
- Custom Post type as Taxonomy
- Display div based on Group metabox selection [closed]
- Custom Sort Order for Custom Post Type Taxonomy