This is untested, but I believe if you set type
in your meta query to numeric
, that will cast the values as numbers so orderby meta_value
should work correctly.
Related Posts:
- Custom WP_Query order by post_meta and (author) user_meta
- WP_Query ordered by custom field that is a date string?
- Order posts by tags count?
- Custom Post order for homepage
- How to orderby multiple meta fields if some fields are empty
- Weird orderby => post__in issue
- Order by summing multiple values
- Order by empty custom field
- WP_Query custom order and pagination
- How to do WP_User_Query for Nested Array value Inside Nested Array field
- Meta query orderby meta_value_num sorting by role first
- WP_User_Query Orderby Not Working
- Order posts by tags count?
- How to get_comments() ordered by date and parent?
- How to query 5 users in random who have published more than 10 posts
- WP Query. Ordering posts by another post types meta
- orderby in WP_QUERY – Use the order from the Dashboard
- Search Functionality broken by the wp 4.2 update
- Get posts that were most recently tagged
- WP_Query orderby date not working
- Order by DESC, ASC in custom WP_Query
- Secondary Sort (fallback) for WP_Query
- Changing the meta_query of the main query based on custom query_vars and using pre_get_posts
- Query Posts in a Predefined Order
- How to uniquely identify queries?
- How do I order pages and categories by ID or name in the same query?
- How to make an activities stream mixing posts and comments?
- How to query for a week using key => value WP_Query argument notation?
- SQL query equivalent to WP User Query
- How to count post type that has a particular term?
- Order posts ascending with number in title
- List taxonomy terms plus their latest post ordered by post date
- Foreach-generated custom tax queries, each with an ajax “Load more” button
- meta_query on a date range using an array of values
- WP_Query Performance Issues with meta_query
- How to detect custom query inside `posts_where` hook?
- Is temporarily overwriting $wp_query a bad idea?
- How to use order RAND() on WordPress?
- How to output different posts per page?
- WordPress WP_Query orderby being overwritten
- Order Posts by meta value AND published date
- Pass array of taxonomy terms to wp_query
- How to orderby meta_value_num with dollar ($) sign
- Order WP_Query by multiple fields, subtracting them from one another
- pre_get_posts order by not working
- merge two query arguments into one WP_Query call
- Using WP_Query in “parse_query” or “pre_get_post” in Posts2Posts
- Query: offset post list, unless it’s a specific category
- How to reduce the number of queries?
- List of the years with posts presented
- Query custom post type by custom taxonomy (category slug)
- WP_Query order result by date AND meta_value
- Order by title without taking into account ‘the’
- WP_Query orderby author__in
- Editing the default wordpress search
- Slow page loads due to WordPress Core Query
- Set global $wp_query/$post variable for dynamic page generation
- How to order posts by title after they have already been sorted by category
- WP_Query with ‘rand’, but equal number of posts from the taxonomy terms given
- meta_value_num not ordering all items
- Meta Query relation “AND” then set array accordingly
- Sort WordPress Posts Meta value by Week not Day
- Is_single() conditional tag returns null in query
- Query posts that contain video?
- Show a 404 error page if Public query variable’s value doesn’t exist?
- Reduce number of SQL queries inside WP_Query loop to fetch author data
- Set front_page programatically after user login via query, while leaving site option alone
- Order is breaking wp_query
- Query where ANDing slug values not working
- How to filter query loop block with a search string from the query parameters
- mysql query order by
- WP_User_Query and user posts
- construct complex queries with WP User Query
- Notice thrown when creating numeric pagination on custom query
- Orderby two meta fields not working
- How to SQL query posts IDs by categories AND authors?
- Post incorrectly excluded when using “category__in”?
- Query multiple post types, but different order for each
- Display posts ONLY from the current logged in user and current week/year/month Elementor posts
- What’s wrong with this meta query? (order by meta key, then title, doesn’t work)
- Custom order of posts in wp_query and different taxonomies
- WordPress Query custom ordering by temporary variable
- Query against multiple locations within single custom post type post
- Order by meta date with a thousanth of a second defaults to post order
- How to make a search query if not found in post table then search in postmeta table?
- Adding Category in WP_Query Not Working
- Merge two queries and remove duplicate
- query_posts based on a meta_key
- Fetch only categorized posts
- Sort by meta key within same day
- Custom pagination (Title, date and teaser)
- Show sticky post before other WP_Query
- Pagination in custom query in a category page
- Get a list of the last posts grouped by author and filtered by category
- Showing posts from 4 categories along with all latest posts
- Pagination in WP query with transient API
- Main loop querying current template’s info only in custom category archive pages, not my posts
- Why does wp_query only display the most recent post when using order ASC?
- Advanced Search – Is this possible?
- new WP_Query with order args – no more distinction between categories