_s: Add custom taxonomy support for term descriptions in taxonomy

archives.

We don't even have to check for a context before printing the
description, `term_description()` does all the heavy lifting for us.

Props @jasondpx. Fixes #128.
This commit is contained in:
obenland 2013-06-27 06:24:26 -07:00
parent 55596d6c67
commit 3a5afef198
1 changed files with 4 additions and 14 deletions

View File

@ -66,20 +66,10 @@ get_header(); ?>
?>
</h1>
<?php
if ( is_category() ) :
// show an optional category description
$category_description = category_description();
if ( ! empty( $category_description ) ) :
echo apply_filters( 'category_archive_meta', '<div class="taxonomy-description">' . $category_description . '</div>' );
endif;
elseif ( is_tag() ) :
// show an optional tag description
$tag_description = tag_description();
if ( ! empty( $tag_description ) ) :
echo apply_filters( 'tag_archive_meta', '<div class="taxonomy-description">' . $tag_description . '</div>' );
endif;
// Show an optional term description.
$term_description = term_description();
if ( ! empty( $term_description ) ) :
printf( '<div class="taxonomy-description">%s</div>', $term_description );
endif;
?>
</header><!-- .page-header -->