took over the maintenance of a site that was very well built BUT each page calls a mutual file that places the title and meta tags. great for maintenance, fast page loading, etc. BUT, not so great if you want to personalize the meta tags (description and keywords) for each page.
So, I want to try to edit the code such that I can personalize the page to have it’s own SE specific content.
As it stands every page of the website has this php code at the start. I know exactly what this all does. And thus, each page is devoid of anything but the pages content. no head elements to tweak as they are generically called in below.
[code=php]<?php
$Session=new Session;
$thispage=$lcon14;
$noside=”noside”;
$headline=”About Us”;
start_page(“About Us”);
?>
These 2 code snippets below are the offending pieces, I think. In 1 single include file that places both the pages title and the browser title you see and adds the meta tags. That is the problem. If I start to tweak this, with my knowledge base, it breaks. I tried several obvious methods with no success. Essentially this include file fills in 4-5 key pieces of ALL of the site pages, but does that from this 1 include file. I need help to dissect this code so we can keep everything running, yet be able to change exactly what we want on each page separately. Because as it stands, we cannot.
[code=php]
/**********************************************
start_page/end_page writes html for all pages
***********************************************/
function start_page($title=””) {
global $headline;
make_header($title);
start_pagetable($headline);
}
[code=php]
/**********************************************
make_header($title=””) writes initial html
***********************************************/
function make_header($title=””,$type=””) {
global $fhname, $addstyle, $thispage;
// $type can be used to adjust background colors or other things
$background=”#FFFFFF”; //change to background color
$title=(!empty($title))?” | $title”:”;
if (!stristr(DNAME, “admin”)) {$bodyclass=”class=”page””;}
?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=ISO-8859-1″ />
<title><?php echo($fhname.$title);?></title>
<meta name=”description” content=”blah blah blah” />
<meta name=”keywords” content=”blah, blah, blah” />
thoughts?