Hi David,
I'd like to add meta tags to my brand pages what would be best way to do this?
I have added code to search.php for the description and keywords but how can I insert just the actual brand into them without including the brand: and : bit?
Hi David,
Thanks for that. I have been messing around with it and is it ok to do it like this? It all seems to work ok.
$header["title"] = htmlentities($q,ENT_QUOTES,$config_charset);
if ($parts[0]=="brand")
{
$header["title"] = "Compare $parts[1] prices";
$header["meta"]["keywords"] = "blah,buy $parts[1],$parts[1] deals,compare,prices";
$header["meta"]["description"] = "Compare $parts[1] prices blah blah blah blah great $parts[1] deals";
}
if ($parts[0]=="merchant")
{
$header["title"] = "blah blah prices from $parts[1] store";
$header["meta"]["keywords"] = "blah,buy $parts[1],$parts[1] deals,compare,prices";
$header["meta"]["description"] = "Great deals from $parts[1] blah blah blah blah great $parts[1] deals";
}
Cheers,
Chris
Hi,
The query is actually split up into the $parts array; so when $parts[0] is "brand", the brand name without any additional characters is in $parts[1], so you could use something like:
if ($parts[0]=="brand")
{
$header["meta"]["keywords"] = "Search results for the brand ".$parts[1];
}
Hope this helps!
Cheers,
David.