Posted - 12/12/2017 : 13:58:19
I have implemented the advanced title tag to a site (products.php) with the following code...
<?php $pno = (isset($_GET['pg']) && is_numeric($_GET['pg'])) ? (int)$_GET['pg'] : 1; $pagenumber = ' page ' . $pno; ?> <title><?php if(!empty($pagetitle) && $pno == 1) {print $pagetitle;} else if(!empty($pagetitle) && $pno != 1){print $pagetitle . $pagenumber;} else if(!empty($sectionname) && $pno == 1) {print $sectionname . ' | ' . $sitename;} else if(!empty($sectionname) && $pno != 1) {print $sectionname . ' | ' . $sitename . $pagenumber;} else if($pno == 1) {print $allpagestitle;} else {print $allpagestitle . $pagenumber;} ?></title>
My question is... On Sub categories, how can this be rewritten to show the category name of the category above WITH the current category? i.e. CATEGORYNAME | CATEGORYABOVE Kind of like a Cheese Spreads Category and the subcategory name is Smoked... the title would read "Smoked | Cheese Spreads | Etc."
Tim Gorski
|