PDA

View Full Version : Custom meta tags per entry


Moonz0r
10-26-2008, 06:34 PM
Have looked all through the forum and I couldn't find a real solution to show your own meta tags per entry. But thanks to a few posts I succeeded in doing so. The generate-your-meta-tags-on-showentry-automaticaly feature is nice, but my experience is that it will show words which you won't want to see displayed on your meta tag.

Make sure you enabled the tag/keywords feature. Next, create a new plugin with the hook vba_dyna_showentry_start. And use the following php code:

$headinclude = str_replace(
'<meta name="keywords" content="' . $vbulletin->options['description'] . '" />',
'<meta name="keywords" content="' . $vba_dyna->_entry['keywords'] . '" />',
$headinclude
);

Check any entry with filled tags/keywords and you'll notice the custom meta tags.

Alternatively you could use a similar plugin for your meta description, but you'll need a custom field for it. Replace the keywords variable for fieldX, with X being the number of your custom field. Fill the field and you'll change the meta description. Also change the keywords sentence in description and in the vbulletin variable ('description').

You can also use your entry title to change it, by replacing keywords with title. And there are more more variables to choose out, although only tags and custom fields will give you the freedom to control every single word.