is_front() from markjaquith and Nazgul. fixes #3682

git-svn-id: http://svn.automattic.com/wordpress/trunk@6704 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-02-02 00:13:34 +00:00
parent 63f6070325
commit 43852a57c3
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;