-
-
Save dancywritter/b156c6a1fbf44ed7cd9ffc12a8376fa7 to your computer and use it in GitHub Desktop.
Check If WordPress Post is Older than X Days
This file contains hidden or 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