Different Titles <head>


#1

Hi there!

My website consists in 3 parts, 2 “statics” one: header.php and footer.php and another one “dynamic”, let’s call it content.php

What happens is, whenever a “dynamic” page, ie: products, about us, contatc, etc… is loaded, the server loads automatically the header.php and footer.php

This actually saves me some time, because when I need to change like an information on the footer, I don’t have to edit too many files, just one (the footer.php).

But I’m facing a small “problem” here, since I have only one header (that contains our TITLE), all my pages have the same title… what is not recommended for Search Engines optimizations… so, here comes the question:

How can I have separate/different page titles if I have only 1 “static” header page…

Thanks in advance,

Steve.


http://daeve.com.br
dreamhosted since 2006.


#2

Remove the TITLE element from header.php and have different ones in contact.php, about.php, etc.

Maximum Cash Discount on any plan with MAXCASH


#3

Thanks sXi !

It looks so obvious now…
I’ve tried this before… but at the first attempt, i forgot to include on the “dynamic” pages…

Thanks for your help.


http://daeve.com.br
dreamhosted since 2006.


#4

No worries. Your site looks fantastic.

Maximum Cash Discount on any plan with MAXCASH


#5

Stop and think about it. Your page is a php page. Why not add a variable to your title tag?

?> //php code before this line (optional)

<?php print $pagetitle; ?> - additional text <?php //php code after this line (optional)

Now your dynamic page can assign a value to $pagetitle. It may be best to assign the variable first them include your header. It’s been awhile since i did any coding so I can’t recall if the whole page gets parsed before displaying or as it runs through the code. Sorry about that.
Silk

My website