|
Cookbook /
Extra Words In Title Tag RecipeSummary: This is a really simple recipe for adding extra words to the title tag in the head.
Version: 1.0.20090707
Prerequisites: TBC
Status: Functional, tested on 2.2.0-beta67
Maintainer: AndyG
Categories: CMS | Administration
Questions answered by this recipeI want to add extra words or phrases to the head->title tag but I don't want these to be shown in the title as it is displayed in the page, how can I do this? DescriptionRecipe that allows you to adding extra words to the title tag in the html head tag but not title page text. NotesThis is a really simple recipe for adding extra words to the title tag in the head. It is intended for use with SEO, so you want the head->title tag to have extra words in it that are not in the title text in the body of the page. Most search engines put a high value on the title tag when deciding relevance to search terms, it is, I think the simplest and most effective SEO option. It's a bit daft having a separate file for it as it is only a few lines of code, but it's better for maintenance that way really. Instructions
Codeas there is not much code, I'll paste in in here for ease of understanding. $RecipeInfo['Extra Words In Title Tag']['Version'] = '1.0.20090707';
Markup("ExtraTitleWords", "directives", '/\\(:ExtraTitleWords (.*?):\\)/e', 'fExtraTitleWords("$1")');
function fExtraTitleWords ($extrawordstring) {
// take the title and add the extrawordstring to the end after a comma.
$GLOBALS["WikiTitle"] .= $GLOBALS["WikiTitle"] . ", " . $extrawordstring;
}
Release notes1.0.20090707 released 7th of July 09.
See alsoContributorsComments
User notes?: If you use, used or reviewed this recipe, you can add your name. The following format is recognized:
* (+) Optional positive comment. Name, date * (-) Optional negative comment. Name, date These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki. |