WordPess Category Descriptions

I’ve been fallowing Jt Pratt’s blogging mistakes and he’s had some interesting ideas on adding content to categories to keep them from becoming duplicate content. Well, a commenter pointed out something when I commented about the category2page plugin that allows you to use a page as a header for a category. Jt, wisely, ran with the idea his commenter posted.

It’s really very easy. The category description. . . yeah, if you are like me they are probably empty. After all, isn’t the name descriptive enough? Well, it turns out that they can be used for a lot more. JT posted his ideas about categories and i thought it was definitely worth mentioning here! Using this idea gets rid of the plugin and/or using category templates which can be a pain. It’s by far the easiest way to add a header of content to any category. This helps solve the duplicate content and allows all you SEO experts to use some keywords towards the top of the page.

The easiest way to go about it is, code your text in an html editor and then past it into the description of the appropriate category. You get all the formatting you want!

Then make a duplicate of the archive.php file in your template theme and rename it to category.php.

Open it up and find the following code:

<?php /* If this is a category archive */ if (is_category()) { ?>
<h2 class="pagetitle">Archive for the '<?php echo single_cat_title(); ?>' Category</h2>

Then add this little line of code after the above code,

<?php echo category_description(); ?>

It’s really that easy! What happens? The above line of code prints the description just under the category title.

Make sure you style this “header” so that people know it’s an introduction to the category. Otherwise it might be a little confusing. As Jt suggests, use a dive so you can give a unique background or indent it to offset it a little form everything else.

After using category templates to add content, then using the cat2page plugin, I’m happy Jt’s poster shared this info with us and JT was wise enough to run with it!

This really is one of those simple tweaks that should be known by all WordPress users. It keeps everything in your database, no extra pages, and no extra template pages.

Now if anyone knows a great trick for tags other than using template tag pages I would love to hear it.

There are no comments on this post

Leave a Reply