Created
March 15, 2015 16:05
-
-
Save besimhu/4bb93ee7cec9e2fac575 to your computer and use it in GitHub Desktop.
Sometimes you just want to have one check that checks if it’s related to the blog. Yes, this uses many functions, so use it as a last resort.
This file contains hidden or 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
// check if it's a blog page | |
function is_blog () { | |
global $post; | |
$posttype = get_post_type($post ); | |
return ( ((is_archive()) || (is_author()) || (is_category()) || (is_home()) || (is_single()) || (is_tag())) && ( $posttype == 'post') ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment