Each Joomla website has a home page from which all other pages are accessible. This unique page which is interlinked with all other pages after a specific number of navigation is called Joomla home page. But practically, it is difficult to identify the homepage in Joomla.
This post covers how to determine whether a user is viewing the Joomla homepage or not. Follow the codes given below as per your Joomla version.
<?php $menu = JSite::getMenu(); if ($menu->getActive() == $menu->getDefault()) { echo 'This is the front page'; } ?>
<?php if(JRequest::getVar('view') == "featured" ) { //You are in! } else { //You are out! } ?>
<?php if(JRequest::getVar('view') == "featured" ) { //You are in! } else { //You are out! } ?>
<?php $app = JFactory::getApplication(); $menu = $app->getMenu(); if ($menu->getActive() == $menu->getDefault()) { echo 'This is the front page'; } ?>
<?php $app = JFactory::getApplication(); $menu = $app->getMenu(); $lang = JFactory::getLanguage(); if ($menu->getActive() == $menu->getDefault($lang->getTag())) { echo 'This is the front page'; } else { echo 'Accueil'; } ?>