Skip to content

Instantly share code, notes, and snippets.

@wpmark
wpmark / gist:9d5d2395cb01a2de0179
Created October 8, 2014 11:06
Check If WordPress Post is Older than X Days
<?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!! */