Jump to content

[SOLVED] Making <title> different for each page, when it is being included


busillis

Recommended Posts

I have a include file called header, that takes the logo and navigation so that i dont need to duplicate code.

 

Problem is, <title> comes with this and I want this to be different for each page.  I.e. "page a - website name", "page b - website name"

 

Any ideas?

Another way would be to set the title in the calling script. i.e. $title = "this is a great website", before the include.  Then replace the <title> tags in the header like wmguk has shown :

<title><?php echo $title; ?></title>

Thanks guys.

 

One additional problem I have realised as well:

 

The navigation is in the header and it differs based on what page you are on; i.e. one of the buttons has a property called "selected".

 

Perhaps if I made all the code in header a function and passed a page name as a param?

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.