Displaying a div layer only in the front page of my site

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
apa@imagix.dk
Forum Newbie
Posts: 2
Joined: Fri Oct 01, 2010 3:12 am

Displaying a div layer only in the front page of my site

Post by apa@imagix.dk »

I have a general header.php file in my site that contains my site menu. I want to include a div layer above the site menu - but only on the front page. Can I do this using PHP... if "on front page" then "<div></div>"

...I obviously don't really know any PHP, but you get the idea.

Hope sombody can help me out!

Best,
Anders
User avatar
DigitalMind
Forum Contributor
Posts: 152
Joined: Mon Sep 27, 2010 2:27 am
Location: Ukraine, Kharkov

Re: Displaying a div layer only in the front page of my site

Post by DigitalMind »

frontpage.php

Code: Select all

define('FRONT_PAGE', TRUE);
require 'header.php';
...
header.php

Code: Select all

if (defined('FRONT_PAGE')) {
    echo '<div></div>';
}
...
Did I get you wrong?
apa@imagix.dk
Forum Newbie
Posts: 2
Joined: Fri Oct 01, 2010 3:12 am

Re: Displaying a div layer only in the front page of my site

Post by apa@imagix.dk »

You got me just right - I works perfectly.

Thanks a million...
Post Reply