Jump to content

exclude content from homepage?


toolman

Recommended Posts

Hi

 

I have a template that displays a left sidebar on all pages.

 

However, I don't want it to display on the homepage (index.php)

 

Is there a way I can make not show on the homepage?

 

I was thinking something like

 

if(homepage){

echo nothing

}

 

else{

echo sidebar}

 

would something like that work?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/191084-exclude-content-from-homepage/
Share on other sites

If your index is not a controller page then

$page = basename($_SERVER['PHP_SELF']);
if ($page == 'index.php'){include("sidebarleft.php");}

 

if your index is a controller page then you already have the pagename as a var so just use the var and the if statement above.

 

 

HTH

Teamatomic

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.