I've been sick so please forgive the stupid question... How is it again that I would check (in the Loop) as to if the date of an entry is greater than 30 days old and display a block of code accordingly?
I've been sick so please forgive the stupid question... How is it again that I would check (in the Loop) as to if the date of an entry is greater than 30 days old and display a block of code accordingly?
I recently posted this (but can't locate the thread...):
<?php
$days_since = floor((date('U') - get_the_time('U')) / 86400);
if($days_since >= 30) :
?>
~ This displays if post 30 days or older ~
<?php endif; ?>
Change:
if($days_since >= 30) :
to:
if($days_since > 30) :
For just 'greater than' 30 days.
This topic has been closed to new replies.