I am trying to compare dates from a custom field. I have them stored as something like "20121125". If the date has expired, a placeholder image will be used, if not, the default thumbnail will be used. Any advice is appreciated.
<?php
$html = "";
$key = get_post_meta($post->ID, 'Due', true);
$date = date('ymd');
if ($key >= $date) {
the_post_thumbnail('medium');
} else {
$html .= '<img src="http://exampleimage.com" alt="">';
}
return $html;
?>