WordPress: Function Reference/get category link:修订间差异
来自站长百科
(新页面: == 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...) |
(→相关的) |
||
(未显示2个用户的6个中间版本) | |||
第1行: | 第1行: | ||
== | == 描述 == | ||
为一个特定的类别ID返回正确的url。 | |||
这是博客文章的一个类别id,而不是链接。 | |||
使用不存在的ID会返回一个链接,链接到母目录 | |||
例子: http://yoursite.com/baseurl/archives/category/ | |||
== | == 用法 == | ||
= | <code><a href="</code>%%%<?php echo get_category_link($cat);?>%%%<code>">类别 名</a></code> | ||
== 参数 == | |||
{{Parameter|$category_id|integer|链接能够重新找回的类别ID。}} | |||
== 相关的 == | |||
{{Tag Category Tags}} | {{Tag Category Tags}} | ||
{{PHP Function Tag Footer}} | {{PHP Function Tag Footer}} | ||
2008年9月27日 (六) 15:04的最新版本
描述[ ]
为一个特定的类别ID返回正确的url。
这是博客文章的一个类别id,而不是链接。
使用不存在的ID会返回一个链接,链接到母目录
例子: http://yoursite.com/baseurl/archives/category/
用法[ ]
<a href="
%%%<?php echo get_category_link($cat);?>%%%">类别 名</a>
参数[ ]
相关的[ ]
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,