Order by custom field date with ASC order

With some more googling:

<?php
$today = date("Y/m/j");
query_posts(array(
'post_type' => 'custompost',
'posts_per_page' => 4,
'meta_key' => 'mydate',
'orderby' => 'meta_value',
'order' => 'ASC',
    'meta_query' => array(
        array(
           'key' => 'mydate',
           'meta-value' => $value,
           'value' => $today,
           'compare' => '>=',
           'type' => 'CHAR'
       )
)
));
if (have_posts()) :
while (have_posts()) : the_post();
?>
    <a href="https://wordpress.stackexchange.com/questions/59767/<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a>

<?php endwhile; ?>
<?php else : ?>
<?php endif; ?> 

I hope it will help others!

Leave a Comment