I have seen the following thread but it’s a bit beyond me…
How can I change the <title> tag dynamically in php based on the URL values
Basically, I have a page index.php (no php in it just named to future proof – maybe now!). It contains numerous lightbox style galleries which can be triggered from an external link by a variable in the URL – e.g. index.php?open=true2, index.php?open=true3, etc.
I would like the index.php title tag – to include existing static data + append additional words based on the URL variable – e.g. if URL open=true2 add “car gallery”, if URL open=true3 add “cat gallery”, if URL has no variable append nothing to title.
Can anyone assist? I have been searching but either missed the point of posts or it hasn’t been covered (to my amateaur level).
Many thanks. Paul.
At the top of your php script put this:
And then use this to include your custom title:
<title>Pauls Great Site<?php echo htmlentities($title); ?></title>