WIKI使用導(dǎo)航
站長(zhǎng)百科導(dǎo)航
站長(zhǎng)專題
- 網(wǎng)站推廣
- 網(wǎng)站程序
- 網(wǎng)站賺錢
- 虛擬主機(jī)
- cPanel
- 網(wǎng)址導(dǎo)航專題
- 云計(jì)算
- 微博營(yíng)銷
- 虛擬主機(jī)管理系統(tǒng)
- 開(kāi)放平臺(tái)
- WIKI程序與應(yīng)用
- 美國(guó)十大主機(jī)
WordPress: Function Reference/get category link:修訂間差異
(新頁(yè)面: == Description == Returns the correct url for a given Category ID. This is a category id of blog posts, not links. Using a nonexistent Category ID will return a link to the parent direc...) ? |
無(wú)編輯摘要 |
||
第1行: | 第1行: | ||
== Description == | == Description == | ||
== 描述 == | |||
Returns the correct url for a given Category ID. | Returns the correct url for a given Category ID. | ||
為一個(gè)特定的類別ID返回正確的url。 | |||
This is a category id of blog posts, not links. | This is a category id of blog posts, not links. | ||
這是博客文章的一個(gè)類別id,而不是鏈接。 | |||
Using a nonexistent Category ID will return a link to the parent directory | Using a nonexistent Category ID will return a link to the parent directory | ||
使用不存在的ID會(huì)返回一個(gè)鏈接,鏈接到母目錄 | |||
eg: http://yoursite.com/baseurl/archives/category/ | eg: http://yoursite.com/baseurl/archives/category/ | ||
例子: http://yoursite.com/baseurl/archives/category/ | |||
== Usage == | == Usage == | ||
== 用法 == | |||
<code><a href="</code>%%%<?php echo get_category_link($cat);?>%%%<code>">category name</a></code> | <code><a href="</code>%%%<?php echo get_category_link($cat);?>%%%<code>">category name</a></code> | ||
<code><a href="</code>%%%<?php echo get_category_link($cat);?>%%%<code>">類別 名</a></code> | |||
== Parameters == | == Parameters == | ||
== 參數(shù) == | |||
{{Parameter|$category_id|integer|The category ID whose link will be retrieved.}} | {{Parameter|$category_id|integer|The category ID whose link will be retrieved.}} | ||
{{Parameter|$category_id|integer|鏈接能夠重新找回的類別ID。}} | |||
== Related == | == Related == | ||
第21行: | 第37行: | ||
[[WordPress:Category:Functions]] | [[WordPress:Category:Functions]] | ||
{{Copyedit}} | |||
== 相關(guān)的 == | |||
{{標(biāo)簽 類別 標(biāo)簽}} | |||
{{PHP 函數(shù) 標(biāo)簽 頁(yè)底文字}} | |||
[[WordPress:Category:Functions|類別:函數(shù)]] | |||
{{Copyedit}} | {{Copyedit}} |
2008年7月1日 (二) 16:22的版本
Description
描述
Returns the correct url for a given Category ID.
為一個(gè)特定的類別ID返回正確的url。
This is a category id of blog posts, not links.
這是博客文章的一個(gè)類別id,而不是鏈接。
Using a nonexistent Category ID will return a link to the parent directory
使用不存在的ID會(huì)返回一個(gè)鏈接,鏈接到母目錄
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.
相關(guān)的
Description
描述
Displays a link to the category or categories a post belongs to. This tag must be used within WordPress:The Loop.
顯示文章所屬的類別的連接。必須在The Loop內(nèi),使用這個(gè)標(biāo)簽。
Usage
用法
%%% <?php the_category('separator', 'parents' ); ?> %%% %%% <?php the_category('separator', 'parents' ); ?> %%%
Examples
Separated by Space
例子
由空格分開(kāi)
This usage lists categories with a space as the separator.
這個(gè)用法用分隔符,隔開(kāi)類別,列出。
<p>Categories: <?php the_category(' '); ?></p>
<p>Categories: <?php the_category(' '); ?></p>
Separated by Comma
用逗號(hào)分開(kāi)
Displays links to categories, each category separated by a comma (if more than one).
顯示類別連接,(如果多于一個(gè)類別)類別之間用逗號(hào)分開(kāi)。
<p>This post is in: <?php the_category(', '); ?></p>
<p>This post is in: <?php the_category(', '); ?></p>
Separated by Arrow
用箭頭分開(kāi)
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.)
用箭頭顯示類別鏈接(>)分開(kāi)類別。(注: 使用這種方法的時(shí)候,應(yīng)該注意,有的訪客認(rèn)為類別后面的> 是前面類別的子類別。)
<p>Categories: <?php the_category(' > '); ?></p>
<p>Categories: <?php the_category(' > '); ?></p>
Separated by a Bullet
用Bullet分開(kāi)
Displays links to categories with a bullet (•) separating the categories.
使用bullet (•)分開(kāi)類別,顯示類別鏈接
%%%
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)鏈接類別之間顯示的文本或者字符。默認(rèn)是將鏈接放在無(wú)序列表上。
- parents
- (string) How to display links that reside in child (sub) categories. Options are:
- parents
- (string)怎樣顯示子類別中的鏈接。選項(xiàng)有:
- 'multiple' - Display separate links to parent and child categories, exhibiting "parent/child" relationship.
- 'multiple' -分開(kāi)顯示母類別和子類別的鏈接,顯示為"母/子"關(guān)系。
- 'single' - Display link to child category only, with link text exhibiting "parent/child" relationship.
- 'single' -只顯示子類別鏈接,鏈接文本顯示為"母/子"關(guān)系。
- Note: Default is a link to the child category, with no relationship exhibited.
:注:默認(rèn)是鏈接到子類別的一個(gè)鏈接,不顯示關(guān)系。
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,
相關(guān)的
模板:PHP 函數(shù)標(biāo)簽頁(yè)底文字
模板:PHP 函數(shù) 標(biāo)簽 頁(yè)底文字
This article is [[WordPress::Category:Copyedits|marked]] as in need of editing. You can help Codex by editing it.