Posted - 03/17/2020 : 07:20:14
It is all here https://www.ecommercetemplates.com/seo/dynamic-title-meta-php.asp, bit okay.
Advanced categories.php settings
Instead of using the above, copy and paste the following lines into vsadmin/includes.php (changing the text for your own)
$GLOBALS['sitenamelong']='The name of your site goes here (around 50-60 characters and unique)'; $GLOBALS['rootcategorytitle']='The page title to appear on the main categories.php page (around 50-60 characters)'; $GLOBALS['rootcategorydescription']='The page meta description to appear on the main categories.php page (around 160 characters max)';
Replace the title and meta description tags on categories.php with the following
<title><?php if(!empty($pagetitle)) {print $pagetitle;} else if(!empty($sectionname)) {print $sectionname . ' | ' . $sitenamelong;} else {print $rootcategorytitle;} ?></title> <meta property="og:title" content="<?php if(!empty($pagetitle)) {print $pagetitle;} else if(!empty($sectionname)) {print $sectionname . ' | ' . $sitenamelong;} else {print $rootcategorytitle;} ?>">
<meta name="Description" content="<?php if(!empty($sectiondescription)) {print str_replace('"','"',$sectiondescription);} else {print $rootcategorydescription;} ?>">
Make sure you test the results by viewing source on your category and sub-category pages.
Advanced products.php settings
Instead of using the above, copy and paste the following lines into vsadmin/includes.php (changing the text for your own)
$GLOBALS['sitename']='The name of your site goes here (around 50-60 characters)'; $GLOBALS['allpagestitle']='The page title to appear on the main products.php page (around 50-60 characters)'; $GLOBALS['allpagesdescription']='The page meta description to appear on the main products.php page (around 160 characters max)';
Replace the title and meta description tags on products.php with the following
<?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>
<meta name="Description" content="<?php if(!empty($sectiondescription) && $pno < 2) {print $sectiondescription;} else if(!empty($sectiondescription) && $pno > 1) {print $sectiondescription . ' ' . $pagenumber;} else if($pno < 2) {print $allpagesdescription;} else {print $allpagesdescription . ' ' . $pagenumber;} ?>">
Make sure you test the results by viewing source on your product pages.
Marshall CENLYT Productions - ms designs Affordable Web Design Custom Ecommerce Designs Responsive Websites Cenlyt.com

|