Making use of Wordpress tags
May 19, 2008
Using tags for the keywords meta tag
There are two ways you can use keyword for your meta tag, the first is to add the following code to your template:
<meta name="keywords" content="ID);
foreach ($metatags as $tagpost) {
$mymetatag = apply_filters('the_tags',$tagpost->name);
$keyword = utf8_decode($mymetatag); // Your filters...
echo $keyword.",";
}
}
?>barbecue, recipes, grilling" />
You should change “barbecue, recipes, grilling” to keywords you want to be used on pages that don’t display a single post.
The second is a plugin I use on this site, called Add-Meta-Tags. I have had no problems using this plugin right out of the box with it’s default settings. Oh, and not only does it add the keyword meta tag, but it uses the excerpt or part of the post to add a description tag too.
Displaying tags for individual posts
You may also want to display the tags associated with each post, for this you are going to have to get your hands dirty. Break open your trusty php editor and find the code that generates the page for a single post, the file will vary on a theme by theme basis. Around where the categories are added to the page add the following:
<?php the_tags('Tagged With&#58; ', ', ', ''); ?>
The code above will add something like the following to your post: Tagged With: elvis, lasvegas, love, marriage, wedding
For more information check out this code on the Wordpress Codex.





