list_cats

函数
list_cats ( $optionall = 1, $all = 'All', $sort_column = 'ID', $sort_order = 'asc', $file = '', $list = true, $optiondates = 0, $optioncount = 0, $hide_empty = 1, $use_desc_for_title = 1, $children = false, $child_of = 0, $categories = 0, $recurse = 0, $feed = '', $feed_image = '', $exclude = '', $hierarchical = false )
参数
  • (int) $optionall
    Required:
    Default: 1
  • (string) $all
    Required:
    Default: 'All'
  • (string) $sort_column
    Required:
    Default: 'ID'
  • (string) $sort_order
    Required:
    Default: 'asc'
  • (string) $file
    Required:
    Default: (empty)
  • (bool) $list
    Required:
    Default: true
  • (int) $optiondates
    Required:
  • (int) $optioncount
    Required:
  • (int) $hide_empty
    Required:
    Default: 1
  • (int) $use_desc_for_title
    Required:
    Default: 1
  • (bool) $children
    Required:
    Default: false
  • (int) $child_of
    Required:
  • (int) $categories
    Required:
  • (int) $recurse
    Required:
  • (string) $feed
    Required:
    Default: (empty)
  • (string) $feed_image
    Required:
    Default: (empty)
  • (string) $exclude
    Required:
    Default: (empty)
  • (bool) $hierarchical
    Required:
    Default: false
返回值
  • (null|false)
相关
  • wp_list_categories()
定义位置
相关方法
wp_list_catslist_authorslist_metawp_list_authorswp_list_categories
引入
0.71
弃用
2.1.0

list_cats: 这是WordPress的一个函数,显示网站上的类别列表。你可以在你的主题的模板文件中使用这个函数来显示一个类别的列表,并可以选择显示类别的名称、描述等。

列出网站类别。

function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_order = 'asc', $file = '', $list = true, $optiondates = 0,
				$optioncount = 0, $hide_empty = 1, $use_desc_for_title = 1, $children=false, $child_of=0, $categories=0,
				$recurse=0, $feed = '', $feed_image = '', $exclude = '', $hierarchical=false) {
	_deprecated_function( __FUNCTION__, '2.1.0', 'wp_list_categories()' );

	$query = compact('optionall', 'all', 'sort_column', 'sort_order', 'file', 'list', 'optiondates', 'optioncount', 'hide_empty', 'use_desc_for_title', 'children',
		'child_of', 'categories', 'recurse', 'feed', 'feed_image', 'exclude', 'hierarchical');
	return wp_list_cats($query);
}

常见问题

FAQs
查看更多 >