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?

Link to comment
Share on other sites

set $title = $_GET['title'];

 

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

 

and then in the url show www.mywebsite.co.uk/index.php?title=this is a great website

 

very basic, and wrong in so many ways but would happily do the job :)

 

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.