is_front() from markjaquith and Nazgul. fixes #3682

git-svn-id: https://develop.svn.wordpress.org/trunk@6704 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2008-02-02 00:13:34 +00:00
parent 8f90310070
commit 53909dbb3b
1 changed files with 27 additions and 0 deletions

View File

@ -134,6 +134,33 @@ function is_feed () {
return $wp_query->is_feed;
}
/**
* is_front() - Is it the front of the site, whether blog view or a WP Page?
*
* @since 2.5
* @uses is_home
* @uses get_option
*
* @return bool True if front of site
*/
function is_front () {
// most likely case
if ( 'posts' == get_option('show_on_front') && is_home() )
return true;
elseif ( 'page' == get_option('show_on_front') && get_option('page_on_front') && is_page(get_option('page_on_front')) )
return true;
else
return false;
}
/**
* is_home() - Is it the blog view homepage?
*
* @since 2.1
* @global object $wp_query
*
* @return bool True if blog view homepage
*/
function is_home () {
global $wp_query;