Template Tags / is_index()

Description

This tag will return true if the current page is the index/homepage (set under Settings > Pages) and false if the page is not the index page. Very useful for controlling layout and visible elements specific to the homepage.

Usage

<?php 
	if ( is_index( $page ) ) 
	{ 
		// ... 
	} 
?>

Parameters

$page

  • optional
  • string
  • default is current page

The slug of the page you would like to test.

Examples

<?php 
	if ( is_index( "projects" ) ) 
	{ 
		// Do something cool 
	} 
?>