I've found a couple of "fixes" on this site, none of which have worked for myself.
The code I am using is <title><?php echo ucfirst(pathinfo($_SERVER['PHP_SELF'], PATHINFO_FILENAME));?> | Test</title>
which is in a file called navbar.php
.
To link the navbar.php file to the actual page being used, I am using the following in [page name].php:
<div id="navbar"></div>
<script>
$(function(){
$("#navbar").load("navbar");
});
</script>
Which places the code from navbar.php into the current page.
The issue is that the title says Navbar | [website name]
instead of [page name] | [website name]
Marking this question as a duplicate is invalid as the other questions do not contain what I am asking nor do they have an answer that works for my code.
Thanks in advance.