Is it possible to sort the post based on a custom field? I have a custom field called "value_date" where I enter a date e.g 20/04/2017 The idea is sort the upcoming dates first in the loop, is possible? I used a template for custom post taxonomy-event-date.php <!-- // The Query // --> <?php if( have_posts() ) { $alt_post = 'alt-post'; while( have_posts() ) { the_post(); $alt_post = $alt_post == 'alt-post' ? '' : 'alt-post'; ?> <div class="box-page-shows-block"> <?php global $wp_query; $postid = $wp_query->post->ID; echo get_post_meta($postid, 'value_date', true); wp_reset_query(); ?> </div> <h2><?php the_title(); ?></h2> <?php } } ?>