Skip to content

Instantly share code, notes, and snippets.

@mattboon
Created October 17, 2011 15:56
Show Gist options
  • Save mattboon/1292935 to your computer and use it in GitHub Desktop.
Save mattboon/1292935 to your computer and use it in GitHub Desktop.
WordPress - Conditional for blog pages
<?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