I’d like to sort my posts by a custom field value.
I have several ‘Posts’ and these all have a custom field called ‘orders’.
I’d like to be able to arrange my Posts based on this integer value. Arrange in ascending order.
Can anyone advise?
$orders = get_post_meta($post->ID, 'orders', true);
Currently I’m just using the standard:
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
- The topic ‘Sort Posts by Custom Field Value?’ is closed to new replies.