Created
October 8, 2014 11:06
-
-
Save wpmark/9d5d2395cb01a2de0179 to your computer and use it in GitHub Desktop.
Check If WordPress Post is Older than X Days
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/******************************* | |
* this will work in the loop | |
*******************************/ | |
/* check if the posts publish date is older than 60 days */ | |
if( strtotime( $post->post_date ) < strtotime('-60 days') ) { | |
/* post is older than 60 days - do something with it!! */ | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment