For numeric data, the orderby
key should have value as meta_value_num
. Use WP_Query and change
'orderby' => 'meta_value'
to
'orderby' => 'meta_value_num'
Related Posts:
- Order by meta value or date?
- Filtering posts by post meta data
- Custom query with query_posts doesn’t show post without certain meta_key
- How to sort by meta value?
- get_post_meta causes database queries
- Querying posts with meta value that begins with a certain pattern
- IF.. post meta show… Conditional Tag Help…?
- order posts by meta value on posts page
- Query_post($args)
- query_posts() on key’s value, or key’s existence
- How to retrieve an array of post IDs by a particular value stored in a custom meta’s array
- Query posts by meta_key whose value is an array
- Exclude posts by post meta value
- Frontend form with multiple posts
- Ordering Posts By Meta Data
- get all posts with certain meta data
- Limiting the amount of posts this displays
- posts_per_page no limit
- How to return results of a get_posts() in explicitly defined order
- Query posts: how to exclude results if post is in multiple categories
- query_posts ->using meta_compare / where meta value is smaller or greater or equals
- How to order posts by descending comment count on taxonomy page?
- WP 5.8 “Query Loop” block: where to place custom query?
- Sort X categories by last update and show image
- Pagination on archive.php page
- order post my meta value m/d/y format with year as included value
- _wp_page_template to dynamically use template
- Schedule Sticky Posts
- WordPress Search Filter Only for Page with Child of Child of Child of Child of Child
- How to display liked posts of current user in wordpress?
- Problem with single-page for my custom post
- How to make the list of post and load on same page with sub-pages [closed]
- How to get 4 Posts after the 5 most recent ones
- How to fetch all posts in a category that were published between two given dates?
- How do I make archives.php for one category only?
- get_meta_data within a loop
- making random query button using $_GET
- Is it possible to query_posts using post__in and then Loop through them in the ordered they were queried?
- using multiple meta_key and meta_value in query_posts
- How do I change the default sort order of a custom column on the posts page?
- WordPress pagination showing same posts on each page
- pass query string on url to filter media
- Co-authors plus problems with query_post
- Error sending array of inputs
- is there a way to show the the post title after the image?
- Authors List page – How to include only those with wp_user_level as Author
- Adding conditional content to single post-type template
- Show Blogroll of another WordPress site
- Why this code causes infinite loop?
- Each post is showing twice in my custom query…?
- query_posts() – problem with “s” parameter
- Unable to get specific value from post meta
- Page title in post query
- Question about querying posts
- Currently using a query_posts() in my theme – want to use a request filter in stead
- How to list most popular post
- Breadcrumbs stop working on a specific template file
- How can I query for all children posts regardless of parent
- INSERT in table row fatal error
- WordPress query reverse order
- How to reverse post navigation at bottom of post
- WP-API: get posts in multiple categories
- Custom post query error
- Multiple instances of query_posts
- Different layout based on post amount?
- If Query Post Returns 1 Post
- How to check a list or feed of all posts under a category and tag?
- Keeping get_posts’ offset and is_paged() synchronized
- odd behaviours from template tags
- How do I add a timezone offset to this query?
- query_posts thumbnail condition
- Show posts from specific roles
- How to add an “or” instead of and “and” (&) in a WordPress query?
- Instead of 4 loops, how can I do it better?
- How to get any type posts include attachments by ids?
- Modify main loop query for paged and meta key
- wordpress query_posts featured page always on top
- Create a Loop with Posts Ordered by Most Recent Comments
- Need to add a space after meta value in query_posts in wordpress for zipcode search
- I need query_posts() to order results first by a meta value and then by post ID
- Specifying image size used in template the_content
- allow user to edit posts made by others users based on the user role
- WordPress custom post type
- Order posts by ACF checkbox
- Post per page not working
- Show previous month’s posts
- why is pre_get_posts not working
- query_posts result differs from wp_query request result
- Query posts based on parents attribute
- Adding Category Argument into an Array for WordPress Query
- orderby not working for query_posts using array of IDs
- Collect posts from last 48 hours
- The_content display a different content from a previous loop
- How to go to tag archives using a form
- Run second query on page based on author of the first query
- WordPress loop problem: Multiple loops, index.php and is_paged causing duplicate posts on next page
- Why doesn’t this page query work?
- Sort posts with multiple meta_keys
- How to get custom post type posts with certain multiple tags names and category id?
- Create “archives by year and week” by category template