This is really simple, but I can't seem to make it work. I want the Due Date text to be red if the current date is past due. I want it to be green if it is still not due yet. Also, I set the due date up to be 2 days past when the wordpress post is made. I need some help though, it all looks good to me, but everything is green regardless of if it is past due or not.
<?php
$current_date = strtotime(date( 'F j, Y g:i A' ));
$expire_date = get_the_date( 'F j, Y g:i A' );
$expire_date = new DateTime($expire_date);
$expire_date->add(new DateInterval('P2D'));
$compare_date = $expire_date->format('F j, Y g:i A');
?>
<?php if( get_field( 'maxpreps_link' ) or get_field( 'khsaa_link' ) ) { echo "<span style='color: green;'>Done!</span>"; } ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" target="_blank" style="color: #0000EE;"><?php the_title(); ?></a>
<span>(<?php echo the_date(); ?>)</span>
<?php
echo (" " . "<span style='float: right; color: ");
if( $compare_date > $current_date ) {
echo "#BA0000"; }
else { echo "#39AC00"; }
echo (";'>Due Date: " . $compare_date . "</span></strong>");