Created
April 4, 2013 00:29
-
-
Save madysondesigns/5306705 to your computer and use it in GitHub Desktop.
WordPress blog check
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
//finally have a function to check if we're anywhere on the damned blog and only the blog | |
function is_blog() { | |
if ( get_post_type() == 'post' || is_post_type_archive( 'post' ) ) { | |
$blog = is_home() || is_archive() || is_single(); | |
return $blog; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
One thing to note, you may want to have a
return false;
after the closing brace for the if statement, always safer to be explicit rather than let PHP decide.