您的当前位置:首页 > 知识博客 > wordpress建站

WordPress获取指定数量RSS条目函数:get_rss

时间:2024-03-11

WordPress函数get_rss用于获取指定数量的RSS条目,get_rss()函数位于rss.php,但自3.0.0版本起,已不建议使用rss.php,因此,推荐使用fetch_feed()函数。

get_rss( string $url, int $num_items = 5 )

函数参数

$url

字符串

feed地址

$num_items

整数

获取RSS的数量。

函数使用示例

include_once(ABSPATH . WPINC . '/rss.php');
echo get_rss('https://www.tiezhushuo.com/feed/', 5);

扩展阅读

get_rss()函数位于:wp-includes/rss.php

相关函数:

  • fetch_rss()

  • wp_rss()


欢迎咨询/Welcome to inquire
tel/vx:18842938855
qq:1685522781
email:1685522781@qq.com

Copyright © 2019-2024 sex.cyou


Whatsapp
Powered by RRZCMS