$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$current_cat = get_query_var('cat');
$args=array(
'category__in' => array($current_cat),
'posts_per_page' => -1,
'paged' => $paged,
'orderby' => meta_value,
'meta_key' => reviews_sort,
'order' => ASC
);
query_posts($args);
The above is a portion of a function I have, and it's giving me fits. It is supposed to sort by the custom field "reviews_sort" and it's sort of, kind of, but not really.
I am assigning values like 10, 20, 25, 30, 40, etc. I have the spacing in between so that I can insert new posts without renumbering them all.
But the posts display "generally" in the right order. But not really right.
I get a feeling that the problem is that the custom field is an alphanumeric field and I'm wanting to sort on numeric values. But since all of my numbers are two character (10-99), it still should work.
Can anyone tell me how to make this work, please?