WP_Query::is_home() public WP 3.1.0
Is the query for the blog homepage?
This is the page which shows the time based blog content of your site.
Depends on the site's "Front page displays" Reading Settings 'show_on_front' and 'page_for_posts'.
If you set a static page for the front page of your site, this function will return true only on the page you set as the "Posts page".
{} It's a method of the class: WP_Query{}
No Hooks.
Return
true/false. Whether the query is for the blog homepage.
Usage
global $wp_query; $wp_query->is_home();
Notes
- See: WP_Query::is_front_page()
Changelog
Since 3.1.0 | Introduced. |
Code of WP_Query::is_home() WP Query::is home WP 5.6
public function is_home() {
return (bool) $this->is_home;
}