Forum Moderators: coopster
<p>Publication was on <?php echo the_date('Y-m-d'); ?>
<? function dateDiff ($d1, $d2) {
// Return the number of days between the two dates:
return round(abs(strtotime($d1)-strtotime($d2))/86400);
} // end function dateDiff
?>
<?php
$date_01 = get_the_date('U');
$date1 = date('Y-m-d', $date_01);
$date2 = '2011-12-15';
echo (dateDiff($date1, $date2));
?>
<?php
if ((dateDiff($date1, $date2)) > 30)
echo '<p>If the post was over 30 days ago, they get this and the prior messages';
elseif ((dateDiff($date1, $date2)) > 20)
echo '<p>If the post was over 20 days ago, they get this and the prior message';
else
echo '<p>If the post was made under 20 days ago, they get this message only';
?>