Skip to content

Instantly share code, notes, and snippets.

Avatar

John Dugan johndugan

View GitHub Profile
@johndugan
johndugan / is_blog.php
Created Nov 24, 2012 — forked from wesbos/is_blog.php
WordPress: is_blog()
View is_blog.php
function is_blog () {
global $post;
$posttype = get_post_type($post );
return ( ((is_archive()) || (is_author()) || (is_category()) || (is_home()) || (is_tag())) && ( $posttype == 'post') );
}
Usage:
<?php if (is_blog()) { echo 'You are on a blog page'; } ?>