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!
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; ?>
<?php$title = "Title";
require("header.php"?>
and then, in header.php
<title><?php echo $title; ?>
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..."
"Presently, page(s) load with php require("header.php"), effectively negating a unique page title..."
1
Whoops. I typed that a little too quickly. Glad to see your problem is solved :)