WIKI使用導航
站長百科導航
站長專題
- 網(wǎng)站推廣
- 網(wǎng)站程序
- 網(wǎng)站賺錢
- 虛擬主機
- cPanel
- 網(wǎng)址導航專題
- 云計算
- 微博營銷
- 虛擬主機管理系統(tǒng)
- 開放平臺
- WIKI程序與應用
- 美國十大主機
WordPress:Function Reference/get category link
Description
描述
Returns the correct url for a given Category ID.
為一個特定的類別ID返回正確的url。
This is a category id of blog posts, not links.
這是博客文章的一個類別id,而不是鏈接。
Using a nonexistent Category ID will return a link to the parent directory
使用不存在的ID會返回一個鏈接,鏈接到母目錄
eg: http://yoursite.com/baseurl/archives/category/
例子: http://yoursite.com/baseurl/archives/category/
Usage
用法
<a href="
%%%<?php echo get_category_link($cat);?>%%%">category name</a>
<a href="
%%%<?php echo get_category_link($cat);?>%%%">類別 名</a>
Parameters
參數(shù)
Related
the_category, the_category_rss, single_cat_title, category_description, wp_dropdown_categories, wp_list_categories, in_category, get_category_parents, get_the_category get_category_link,
This article is [[WordPress::Category:Copyedits|marked]] as in need of editing. You can help Codex by editing it.
相關的
Description
描述
Displays a link to the category or categories a post belongs to. This tag must be used within WordPress:The Loop.
顯示文章所屬的類別的連接。必須在The Loop內,使用這個標簽。
Usage
用法
%%% <?php the_category('separator', 'parents' ); ?> %%% %%% <?php the_category('separator', 'parents' ); ?> %%%
Examples
Separated by Space
例子
由空格分開
This usage lists categories with a space as the separator.
這個用法用分隔符,隔開類別,列出。
<p>Categories: <?php the_category(' '); ?></p>
<p>Categories: <?php the_category(' '); ?></p>
Separated by Comma
用逗號分開
Displays links to categories, each category separated by a comma (if more than one).
顯示類別連接,(如果多于一個類別)類別之間用逗號分開。
<p>This post is in: <?php the_category(', '); ?></p>
<p>This post is in: <?php the_category(', '); ?></p>
Separated by Arrow
用箭頭分開
Displays links to categories with an arrow (>) separating the categories. (Note: Take care when using this, since some viewers may interpret a category following a > as a subcategory of the one preceding it.)
用箭頭顯示類別鏈接(>)分開類別。(注: 使用這種方法的時候,應該注意,有的訪客認為類別后面的> 是前面類別的子類別。)
<p>Categories: <?php the_category(' > '); ?></p>
<p>Categories: <?php the_category(' > '); ?></p>
Separated by a Bullet
用Bullet分開
Displays links to categories with a bullet (•) separating the categories.
使用bullet (•)分開類別,顯示類別鏈接
%%%
Post Categories: <?php the_category(' • '); ?>
%%% %%%
文章類別: <?php the_category(' • '); ?>
%%%
Parameters
參數(shù)
- separator
- (string) Text or character to display between each category link. The default is to place the links in an unordered list.
;分隔符: (string)鏈接類別之間顯示的文本或者字符。默認是將鏈接放在無序列表上。
- parents
- (string) How to display links that reside in child (sub) categories. Options are:
- parents
- (string)怎樣顯示子類別中的鏈接。選項有:
- 'multiple' - Display separate links to parent and child categories, exhibiting "parent/child" relationship.
- 'multiple' -分開顯示母類別和子類別的鏈接,顯示為"母/子"關系。
- 'single' - Display link to child category only, with link text exhibiting "parent/child" relationship.
- 'single' -只顯示子類別鏈接,鏈接文本顯示為"母/子"關系。
- Note: Default is a link to the child category, with no relationship exhibited.
:注:默認是鏈接到子類別的一個鏈接,不顯示關系。
Related
the_category, the_category_rss, single_cat_title, category_description, wp_dropdown_categories, wp_list_categories, in_category, get_category_parents, get_the_category get_category_link,
相關的
This article is [[WordPress::Category:Copyedits|marked]] as in need of editing. You can help Codex by editing it.