category_description() WordPress Function

The category_description() function is used to display the description for a category. The function takes one parameter, the category ID.

category_description( int $category ) #

Retrieves category description.


Parameters

$category

(int)(Optional) Category ID. Defaults to the current category ID.


Top ↑

Return

(string) Category description, if available.


Top ↑

More Information

If used in the archive.php template, place this function within the is_category() conditional statement.
Otherwise, this function will stop the processing of the page for monthly and other archive pages.


Top ↑

Source

File: wp-includes/category-template.php

function category_description( $category = 0 ) {
	return term_description( $category );
}


Top ↑

Changelog

Changelog
VersionDescription
1.0.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.