WordPress.org

Ready to get started?Download WordPress

Codex

Function Reference/is home

Contents

Description

This Conditional Tag checks if the blog posts index page is being displayed. This is a Boolean function, meaning it returns either TRUE or FALSE.

Note: WordPress 2.1 handles this function differently than prior versions - See static Front Page. If you select a static Page as your frontpage (see is_front_page()), this tag will be applied to your "posts page".

Usage

<?php is_home(); ?>

Parameters

This tag does not accept any parameters.

Return Values

(boolean) 
True on success, false on failure.

Examples

The following example can be used in your sidebar to display different content when displaying home page.
<?php
if ( is_home() ) {
    
// This is a homepage
} else {
    
// This is not a homepage
}
?>

Notes

is_home uses the global $wp_query WP_Query object. is_home isn't usable before the parse_query action.

Change Log

Since: 1.5.0

Source File

is_home() is located in wp-includes/query.php.

Related

See also index of Function Reference and index of Template Tags.