Template Tags/category description
Материал из WordPress Wiki
Содержание |
Description
Returns the description of a category.
Usage
%%% <?php echo category_description($category); ?> %%%
Examples
Default Usage
Displays the description of a category, given it's 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.
%%%<?php echo category_description(3); ?>
%%%Result:
WordPress is a favorite blogging tool of mine and I share tips and tricks for using WordPress here.
Note: if there is no category description, the function returns a br tag
With Category Title
%%%<?php single_cat_title('Currently browsing'); ?> : <?php echo category_description(); ?>
%%%Result:
Currently browsing WordPress: WordPress is a favorite blogging tool of mine and I share tips and tricks for using WordPress here.
Parameters
- category
- (integer) The numeric ID of the category for which the tag is to return the description. Defaults to the current category, if one is not set.