October 29th, 2006
How to display the category description in WordPress
When creating categories in WordPress, you can enter a description. The description field is plain text, but you can enter HTML. However, by default, WordPress doesn't even display the description when you're browsing the category!
This little bit of PHP code will override that. If your template has only one index.php that handles all page request, edit that. Otherwise, if there's an archive.php, edit that instead.
<?php if (is_category()) { ?>
<h2 class="pagetitle">'<?php echo single_cat_title(); ?>' Category</h2>
<div id="category-description"> <?php echo category_description(); ?> </div>
<?php } ?>
<h2 class="pagetitle">'<?php echo single_cat_title(); ?>' Category</h2>
<div id="category-description"> <?php echo category_description(); ?> </div>
<?php } ?>
