Michael

I have a question about Dynamic Page Titles. Presently, page(s) load with php require("header.php"), effectively negating a unique page title. What is the dynamic solution? Say, grabbing "title" from page-name-is-here.php file naming? TIA!

Asked by Michael 2 years ago php pages titles


Michael Mior
1

Most Helpful

Most Helpful

 
What you can do is specify the title (and any other parameters you want) in global variables above the require statements. Then you can access these in the files which are included. So you can have something like

<?php$title = "Title";

require("header.php"?>

and then, in header.php

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

by Michael Mior 2 years ago

Michael
0
 
Sorry, should have realized the code would be stripped. Here it is without the bracketing:

"Presently, page(s) load with php require("header.php"), effectively negating a unique page title..."

by Michael 2 years ago

unregistered
1
 
Whoops. I typed that a little too quickly. Glad to see your problem is solved :)

by unregistered 2 years ago

Answer this question

I have a question about Dynamic Page Titles. Presently, page(s) load with php require("header.php"), effectively negating a unique page title. What is the dynamic solution? Say, grabbing "title" from page-name-is-here.php file naming? TIA!

0 errors found:

 
0