forked from mirror/_s
_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:
parent
55596d6c67
commit
3a5afef198
18
archive.php
18
archive.php
|
@ -66,20 +66,10 @@ get_header(); ?>
|
||||||
?>
|
?>
|
||||||
</h1>
|
</h1>
|
||||||
<?php
|
<?php
|
||||||
if ( is_category() ) :
|
// Show an optional term description.
|
||||||
// show an optional category description
|
$term_description = term_description();
|
||||||
$category_description = category_description();
|
if ( ! empty( $term_description ) ) :
|
||||||
if ( ! empty( $category_description ) ) :
|
printf( '<div class="taxonomy-description">%s</div>', $term_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;
|
|
||||||
|
|
||||||
endif;
|
endif;
|
||||||
?>
|
?>
|
||||||
</header><!-- .page-header -->
|
</header><!-- .page-header -->
|
||||||
|
|
Reference in New Issue