I want to do an if statement where, if post is newer than this date do this, but if post is older than this date do that
Anyone have any ideas?
I want to do an if statement where, if post is newer than this date do this, but if post is older than this date do that
Anyone have any ideas?
<?php
$today = date("r");
$articledate = get_the_time('r');
$difference = round((strtotime($today) - strtotime($articledate))/(24*60*60),0);
if ($difference >= 25) {
Do Stuff Here
}else{
Do Stuff Here
}
?>
You must log in to post.