Sort Posts by Custom Field Value?
-
Hi,
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(); ?>
Many thanks
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Sort Posts by Custom Field Value?’ is closed to new replies.