Codex tools: Log in / create account
Languages: English • עברית • Türkçe • (Add your language)
Contents |
This Conditional Tag checks if the main 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".
<?php is_home(); ?>
This tag does not accept any parameters.
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
}
?>
Since: 1.5.0
is_home() is located in wp-includes/query.php.
is_home(), is_front_page(), is_search(), is_404(), is_singular(), is_page(), is_attachment(), is_local_attachment(), is_single(), is_sticky(), is_archive(), is_category(), is_tag(), is_author(), is_date(), is_year(), is_month(), is_day(), is_time(), is_admin(), is_preview(), is_paged(), is_page_template(), is plugin active(), is_plugin_page(), is_new_day(), is_feed(), is_trackback(), is_comments_popup(), comments_open(), pings_open(), is_taxonomy(), is_taxonomy_hierarchical(), is_term(), is_user_logged_in(), is_blog_installed(), is_active_sidebar(), is_dynamic_sidebar(), is_active_widget(), in_the_loop(), in_category(), has_tag(), has_excerpt()