Created
October 17, 2011 15:56
-
-
Save mattboon/1292935 to your computer and use it in GitHub Desktop.
WordPress - Conditional for blog pages
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
<?php | |
function is_blog() { | |
global $post; | |
$post_type = get_post_type($post); | |
return (is_home() || is_archive() || is_single()) && ($post_type == 'post')); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment