Posted on:
January 8th, 2010
Returns the description of a category defined in the category settings screen for the current category (Posts > Categories).
<?php echo category_description( $category ); ?>
Displays the description of a category, given its id, by echoing the return value of the tag. If no category given and used on a category page, it returns the description of the current category.
<div><?php echo category_description(3); ?></div>
*Note* – if there is no category description, the function returns a br tag
Displays the description of a category, using a category slug.
<?php echo category_description(get_category_by_slug('category-slug')->term_id); ?>
<div><strong><?php single_cat_title('Currently browsing'); ?>
</strong>: <?php echo category_description(); ?></div>
Tags: How To