WordPress 中文文档

Function Reference/get category parents

出自WordPress Chinese 中文文档

跳转到: 导航, 搜索

wordpress.org.cn

目录

Description

Returns a list of the parents of a category, including the category, sorted by ID.

Usage

%%% ?php echo(get_category_parents(category, display link, separator, nice name)); ? %%%

Example

Returns the parent categories of the current category with links separated by 'raquo;'

?php echo(get_category_parents($cat, TRUE, ' amp;raquo; ')); ?

will output:

Internet raquo; Blogging raquo; WordPress raquo;

Parameters

category 
(integer) The numeric category ID for which to return the parents. Defaults to current category, if one is set.
display link 
(boolean) Creates a link to each category displayed.
separator 
(string) What to separate each category by.
nice name 
(boolean) Return category nice name or not (defaults to FALSE).

Related

the_category, the_category_rss, single_cat_title, category_description, wp_dropdown_categories, wp_list_categories, get_the_category, get_category_parents, get_category_link, is_category, in_category

includeonlydiv style=clear:both; background-color:#F7F7F7; border:1px solid #CCCCCC; color:#000000; padding:7px; margin:0.5em auto 0.5em auto; vertical-align:middle;See also index of Function Reference and index of Template Tags./div/includeonlynoinclude

Description

This Template is used by Codex:Template Messages.

Usage

pre 已侦测回归模板: Template:Message /pre

Result

已侦测回归模板: Template:Message

/noinclude

wordpress