WP_Query::is_home() WordPress Method

The WP_Query::is_home() method is used to check if the query is for the front page of the site.

WP_Query::is_home() #

Is the query for the blog homepage?


Description

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".

Top ↑

See also


Top ↑

Return

(bool) Whether the query is for the blog homepage.


Top ↑

Source

File: wp-includes/class-wp-query.php

	public function is_home() {
		return (bool) $this->is_home;
	}


Top ↑

Changelog

Changelog
VersionDescription
3.1.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More