WordPress:Function Reference/get category feed link
来自站长百科
Description
描述
Released with WordPress:Version 2.5, this function returns a link to the feed for all posts in the specified category. A particular feed can be requested, but if the feed parameter is left blank, it returns the 'rss2' feed link. This function replaces the deprecated get_category_rss_link function.
这个函数是在2.5版本时候发行的,为某个类别中的所有文章返回feed的链接。需要一个特别的feed,但是如果feed参数是空白的,返回'rss2' feed链接。这个函数代替了取消的get_category_rss_link函数。
Usage
用法
%%% <?php get_category_feed_link('cat_id', 'feed'); ?> %%%
%%% <?php get_category_feed_link('cat_id', 'feed'); ?> %%%
Examples
例子
Default Usage
默认用法
Return the rss2 feed link for post in category 2
返回类别2中的文章的rss2 feed链接。
<?php get_category_feed_link('2', ''); ?>
<?php get_category_feed_link('2', ''); ?>
Parameters
参数
- cat_id
- (string) Category ID of feed link to return.
- cat_id
- (string)将要返回的feed链接的类别ID。
- feed
- (string) Type of feed, if left blank uses, by default, the 'rss2' feed.
- feed
- (string)feed的类型,如果是空白的,默认情况下,类型是'rss2' feed。
Depreciated Function
取消的函数
get_category_rss_link get_category_rss_link