Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End [Solved] Page Titles in PHP Re: [Solved] Page Titles in PHP

#79202
ScrewzLuse
Member

There’s definitely different ways of doing this. For me, I kind of like keeping it simple.

Page1.php

Code:

Header.php

Code:
My Site | <?php echo $pagetitle; ?>

Alternatively, you could have something like this in your Header.php file which checks if PageTitle is set at all and if it is, use that instead of the default "My Site"

Code:
<br /> <?php if ($pageTitle) echo $pageTitle else echo "My Site"; ?><br />

You could do it based on the php page name itself but it’s all preference to me.