So, I have a simple website with dynamically generated menu in the header and footer sections (different style for both, for footer more like a page map). I include header and footer blocks with php. So, I have a problem: I need the header and footer blocks to be seen only on other pages, not the first one- Home- page, because of different styling. I tried to do : if (content == "home") { echo .header, .footer { display: hidden;"}; but it doesn't work when I first load the page! Maybe you guys have some ideas? Thank you in advance!
Here is my code:
<?php
$languages = array("eng","lat", "ru");
$sections = array("home", "about", "cafe", "catering", "gallery", "contact");
$sectionTitles = array("eng" =>array("ABOUT US", "CAFE MENU"), "lat"=>array("PAR MUMS", "ĒDIENKARTE"), "ru" =>array("ru1","ru2",));
$lang = "eng";
$section = "home";
$content = explode("/", $_SERVER['REQUEST_URI']);
if (!empty($content[2]) && (in_array($content[2], $languages))) { $lang = $content[2];}
if (!empty($content[3]) && (in_array($content[3], $sections))) { $section = $content[3];}
$sectionTitles = $sectionTitles[$lang];
require_once ("header.php");
require_once ("$lang/$section.php");
require_once ("footer.php");
?>
Header file:
<div class="header">Some header info+menu. Not visible on first page</div>
Content file:
<div class="content">Content different for every page.</div>
Footer file:
<div class="footer">Footer info+page map. Not visible on first page.</div>