Codex tools: Log in / create account
This function has been deprecated. That means it has been replaced by a new function or is no longer supported, and may be removed from future versions. All code that uses this function should be converted to use its replacement if one exists.
Contents |
Displays a list of Categories as links. When one of those links is clicked, all the posts in that Category will display in the appropriate Category Template dicatated by the Template Hierarchy rules. This tag works like the wp_list_cats tag, except that list_cats uses a long query string of arguments while wp_list_cats uses text-based query arguments. WordPress 2.1 saw the introduction of a new and more inclusive template tag wp_list_categories, intended to replace wp_list_cats and list_cats.
<?php list_cats(optionall, 'all', 'sort_column',
'sort_order', 'file', list, optiondates,
optioncount, hide_empty, use_desc_for_title,
children, child_of, 'Categories', recurse,
'feed', 'feed_img', 'exclude',
hierarchical); ?>
Displays the list of Categories using default settings:
<?php list_cats(); ?>
Displays the list of Categories, with not all Categories linked, and sorted by Category name:
<?php list_cats(FALSE, ' ', 'name'); ?>
Sets the list to not list all the Categories (based upon further parameters), sorts by ID in ascending order and in an unordered list (<ul><li>) without dates or post counts, does not hide empty Categories, uses Category "description" for the title in the links, does not show the children of the parent Categories, and excludes Categories 1 and 33:
<?php list_cats(FALSE, '', 'ID',
'asc', '', TRUE, FALSE,
FALSE, FALSE, TRUE,
FALSE, FALSE, '', FALSE,
'', '', '1,33',
TRUE); ?>
When the 'list' parameter is set for an unordered list, the list_cats() tag automatically begins and ends with UL and each item listed as an LI.
To use the query string to pass parameters to generate a list of Categories, see wp_list_cats()
the_category, the_category_rss, single_cat_title, category_description, wp_dropdown_categories, wp_list_categories, in_category, get_category_parents, get_category_link, get_the_category