Check if the current page is the front page.
Boolean value: TRUE if the current page is the front page; FALSE if otherwise.
function drupal_is_front_page() {
// Use the advanced drupal_static() pattern, since this is called very often.
static $drupal_static_fast;
if (!isset($drupal_static_fast)) {
$drupal_static_fast['is_front_page'] =& drupal_static(__FUNCTION__);
}
$is_front_page =& $drupal_static_fast['is_front_page'];
if (!isset($is_front_page)) {
$is_front_page = current_path() == config('system.site')
->get('page.front');
}
return $is_front_page;
}