Same name and namespace in other branches
  1. 5.x includes/path.inc \drupal_is_front_page()
  2. 6.x includes/path.inc \drupal_is_front_page()
  3. 7.x includes/path.inc \drupal_is_front_page()

Check if the current page is the front page.

Return value

Boolean value: TRUE if the current page is the front page; FALSE if otherwise.

1 call to drupal_is_front_page()
_phptemplate_default_variables in themes/engines/phptemplate/phptemplate.engine
Adds additional helper variables to all templates.

File

includes/path.inc, line 203
Functions to handle paths in Drupal, including path aliasing.

Code

function drupal_is_front_page() {

  // As drupal_init_path updates $_GET['q'] with the 'site_frontpage' path,
  // we can check it against the 'site_frontpage' variable.
  return $_GET['q'] == drupal_get_normal_path(variable_get('site_frontpage', 'node'));
}