I'm creating a wordpress site for my father in law's restaurant. Each course has a number that I list using 'orderby' of a advanced custom field containing a number.
In the segment with numbers 6-10 the number 10 shows up as the first element, and I would like it to show up after 9.
Every other segment works just fine.
Example:
-Segment- 1 2 3 4 5 -Segment- 10 6 7 8 9 -Segment- 11 12 13
This is my query.
<?php
// The Query
query_posts( array (
'category_name' => 'example',
'posts_per_page' => -1,
'meta_key' => 'number',
'orderby' => 'meta_value',
'order' => 'ASC'
) );
?>
<?php while ( have_posts() ) : the_post(); ?>
Content
<?php endwhile;?>
<?php
// Reset Query
wp_reset_query();
?>
Thanks!
Solved!
By removing: 'orderby' => 'meta_value',
I was able to order just by 'asc'.
<?php
// The Query
query_posts( array (
'category_name' => 'example',
'posts_per_page' => -1,
'meta_key' => 'number',
'order' => 'ASC'
) );
?>
<?php while ( have_posts() ) : the_post(); ?>
Content
<?php endwhile;?>
<?php
// Reset Query
wp_reset_query();
?>