Order and Orderby not functioning as specified
-
Greetings,
I have a site in with a custom post type representing patents. Each patent number is the Post Title.
Some start with letters, most start with numbers.
The higher the patent number, the more recent it is.
So, I have the query set like so:$args = array ( 'post_type' => 'patent', 'order' => 'DESC', 'orderby' => 'title', 'posts_per_page' => -1, ); $patent_query = new WP_Query( $args );
The problem is that the order is putting the letters at the top. I want the numbers all to be at the top, then the letters.
On the codex page it says that’s how it should be showing.Order & Orderby Parameters
Sort retrieved posts.
order (string) – Designates the ascending or descending order of the ‘orderby’ parameter. Defaults to ‘DESC’.
‘ASC’ – ascending order from lowest to highest values (1, 2, 3; a, b, c).
‘DESC’ – descending order from highest to lowest values (3, 2, 1; c, b, a).But the results are not doing that.
It’s doing (c, b, a, 3, 2, 1) see here: https://cl.ly/image/0P0W1u1M2z25Any thoughts on how to make the results show as they’re supposed to?
Much thx!
- The topic ‘Order and Orderby not functioning as specified’ is closed to new replies.