Skip to content

Instantly share code, notes, and snippets.

@coreyweb
Created January 19, 2014 14:58
Show Gist options
  • Save coreyweb/8506007 to your computer and use it in GitHub Desktop.
Save coreyweb/8506007 to your computer and use it in GitHub Desktop.
Check post date in a WordPress post and establish rules for before and after a certain date
<?php
if (strtotime($post->post_date) > strtotime('January 01 2014')) {
// this is a newer post
} else {
// this is an older post
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment