I'm trying to create a list of 10 products with a publication date in the future ordered most recent to most in the future. The publication date is stored as longtext in an Advanced Custom Field called "publication_daet" in Ymd format. The code I'm using is below but the results are not as expected (results are below the code block). Any ideas?
<section id="recent">
<ul class="row-fluid">
<?php
$today = date('m/d/Y');
$args = array(
'post_type' => 'product',
'showposts' => 10,
'meta_key' => 'publication_date',
'meta_value' => $today,
'meta_compare' => '>',
'order' => 'ASC',
);
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post(); global $product; ?>
<li class="span3">
<a id="id-<?php the_id(); ?>" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
<b><?php $date = DateTime::createFromFormat('Ymd', get_field('publication_date'));?><?php echo $date->format('m/d/Y'); ?></b>: <?php the_title(); ?>
</a>
</li><!-- /span3 -->
<?php endwhile; ?>
<?php wp_reset_query(); ?>
</ul><!-- /row-fluid -->
</section><!-- /recent -->
Results:
11/20/2013: The Capitals
09/03/2015: Orphan Black Card Game
07/10/2014: Sons of Anarchy Men of Mayhem
07/25/2013: Unicorno Frenzies
06/25/2015: Medieval Academy
07/03/2014: Krosmaster Arena DuelPack
01/29/2015: Redacted
06/15/2010: 3:16 Carnage Amongst the Stars
04/29/2015: BattleTech Recon Lance Pack
12/17/2014: Duke Siege Engines Middle Ages