| 5 path.inc | drupal_is_front_page() |
| 6 path.inc | drupal_is_front_page() |
| 7 path.inc | drupal_is_front_page() |
| 8 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.
File
- includes/
path.inc, line 202 - Functions to handle paths in Drupal, including path aliasing.
Code
<?php
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'));
}
?>Login or register to post comments