Im trying to do a query where i get certain posts ordered by 2 ACF fields, they are both numeric, but its not returning the proper order, its like their treating it like text, like 2 is above 1 and also above 12. Did i miss something here?
This is only a guess, but what I think you are running into is a conflict with an existing WP_Query parameter. “year” is an argument that already has a special meaning to WP_Query. Are the posts being ordered by the post date “Year”? Try changing your clause name to something else. It is generally a good idea to use things like “year_clause” and “num_clause” to make sure you don’t end up with conflicts in naming.
Note that the numeric values that this person wants to order by uses nested meta queries using both ‘>=’ and ‘<=’ comparison with no values so that it will return anything that has any value except an empty string or is non-existing.
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users