Wordpress custom taxonomy term description
June 7, 2010 | Wordpress tutorials | 2 Comments »
I was looking for a simple solution to make “sticky” posts in certain places like custom taxonomies or categories, but failed to find simple approach to the problem. Default feature “sticky posts” is good if we want sticky posts at the top of homepage, but it’s getting complicated if we want them in other places, so I started looking for another way around.
Then I remembered that tags and categories may have a description, that solved my problem, because I just needed some intro text about every custom taxonomy term (like mini profile).
To show category or tag description on your theme:
<?php echo category_description(); ?>
<?php echo tag_description(); ?>
You can use them like that for example:
In category.php
<?php
if ( category_description() !== '' ) { ?>
<div class="somestyle">
<?php echo category_description(); ?>
</div>
<?php } ?>
In taxonomy.php or tag.php
<?php
if ( tag_description() !== '' ) { ?>
<div class="somestyle">
<?php echo tag_description(); ?>
</div>
<?php } ?>
Code will check for descriptions and output them wraped in div, if they exist.

You might want to consider the Term Description function too: http://codex.wordpress.org/Function_Reference/term_description
I like your second one the most it is more relatively easy