Skip to content

Instantly share code, notes, and snippets.

@efarem
Created October 1, 2013 15:45
Show Gist options
  • Save efarem/6780526 to your computer and use it in GitHub Desktop.
Save efarem/6780526 to your computer and use it in GitHub Desktop.
WordPress function to tell if you're on a blog page, current page is a blog page
<?php
/**
* Are we on a blog page?
*
* @return bool
**/
function is_blog()
{
return (is_post_type_archive('post') || is_author() || is_category() || is_home() || is_singular('post') || is_tag()) ? true : false ;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment