get_category_parents

Sponsored Link

IDでソートされた、カテゴリーを含むカテゴリーの親のリストを返します。

Sponsored Link

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

get_category_parentsのファンクションタグ使用方法

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

‘»’で区切られたリンクと共に現在のカテゴリーの親カテゴリを返します。

Returns the parent categories of the current category with links separated by ‘≫’

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

will output:

Internet ≫ Blogging ≫ WordPress ≫

get_category_parentsのパラメーター

category

(integer) 対象の親を返すための数値カテゴリIDです。デフォルトは現在のカテゴリで、1つの場合に設定されます。

(integer) The numeric category ID for which to return the parents. Defaults to current category, if one is set.

display link

(boolean) 表示されている各カテゴリへのリンクを作成します。

(boolean) Creates a link to each category displayed.

separator

(string) 各カテゴリーを区切る何かです。

(string) What to separate each category by.

nice name

(boolean) カテゴリーのナイス名を返すかどうか(デフォルトはFALSEです)。

(boolean) Return category nice name or not (defaults to FALSE).

関連ファンクションタグ

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

Sponsored Link