Skip to content

Instantly share code, notes, and snippets.

@collegeman
Created June 30, 2011 18:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save collegeman/1056904 to your computer and use it in GitHub Desktop.
Save collegeman/1056904 to your computer and use it in GitHub Desktop.
Compare post date to cut off date (for layouts)
<?php
$postDate = strtotime( $post->post_date );
$oldDate = strtotime( '2011-06-29' );
if ( $postDate > $oldDate ) {
echo 'do the new thing';
} else {
echo 'do the old thing';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment