Hi so I have a custom loop that is supposed to show upcoming events only it's not taking into account the year so it's displaying future events as being in the past due to just the month and date.
<ul class="upcoming">
<?php // Get today's date in the right format
$todaysDate = date('m/d/y H:i:s');
?>
<?php query_posts('showposts=2&cat=9&meta_key=Date&meta_compare=>=&meta_value=' . $todaysDate . '&orderby=meta_value&order=ASC'); ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : ?>
<?php the_post(); ?>
<li>
<?php
$Date = get_post_meta($post->ID, 'Date', true);
?>
<?php if ($Date) : ?>
<div class="date"><span class="month"> <?php echo date('M',strtotime($Date));?> </span>
<span class="day"><?php echo date('j',strtotime($Date));?> </span></div>
<?php endif; ?>
<h4 class="EventTitle"><a href="<?php the_permalink(); ?>" title="Permanent link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h4>
<span class="EventType"><?php
foreach((get_the_category()) as $childcat) {
$category_link = get_category_link(
$childcat );
if (cat_is_ancestor_of(10, $childcat)) {
if (in_category('13'))
echo "<a href=\"$category_link\">Workshop</a>";
else echo "<a href=\"$category_link\">$childcat->cat_name</a>";
}}
?>
</span>
</li>
<?php endwhile; ?>
<?php else : ?>
<p>Check back soon for new events.</p>
<?php endif; ?>
<?php wp_reset_query(); ?>
The ouput for this module is "Check back soon for new events", regardless of the fact that there are future events available.
I've scoured this thing for hours and can't come up with a reason for why it's ignoring the year. Any ideas?