Hi David,
I would like to modify the meta tag description of the category an brand pages. In the serach.php i now have the code:
$header["meta"]["description"] = "some text ".htmlentities(str_replace("category:","categorie: ",$q),ENT_QUOTES,$config_charset)." some text";
In the category pages the word "category:" changes to "categorie: ".
In the brandpages I want the word "brand:" to change to "merk: ".
Any idea?
Thank you.
Hello,
now in product.php I'm using this:
$header["title"] = htmlentities($q,ENT_QUOTES,$config_charset)." - ".htmlentities($product["products"][0]["category"],ENT_QUOTES,$config_charset);
$header["meta"]["description"] = htmlentities($description,ENT_QUOTES,$config_charset);
Is it possible to add the category too in the meta description?
Thanks!
Hi,
Sure - to append it afterwards (after a SPACE), have a go with:
$header["meta"]["description"] = htmlentities($description,ENT_QUOTES,$config_charset)." ".$product["products"][0]["category"];
Cheers,
David.
and to add it at the beginning of the description?
Thanks again :-)
Hi,
Give it a go like this...
$header["meta"]["description"] =
$product["products"][0]["category"]." ".htmlentities($description,ENT_QUOTES,$config_charset);
Cheers,
David.
Hi,
You could do it like this, using arrays as the parameters to str_replace():
$header["meta"]["description"] = "some text ".htmlentities(str_replace(array("category:","brand:"),array("categorie: ","merk: "),$q),ENT_QUOTES,$config_charset)." some text";
Hope this helps!
Cheers,
David.