简体   繁体   English

WordPress RSS 中超过10个帖子的参数

[英]Parameter for more than 10 posts in WordPress RSS

I need to generate an RSS feed for posts in WordPress that contains more than the usual 10-or-so items.我需要为 WordPress 中的帖子生成一个 RSS 提要,其中包含超过通常的 10 个左右的项目。 I understand that somewhere I need to do something such as query_posts( 'posts_per_page=-1' );我知道在某处我需要做一些事情,例如query_posts( 'posts_per_page=-1' ); , but I have absolutely no idea where. ,但我完全不知道在哪里。 (I am new to WordPress development.) (我是 WordPress 开发的新手。)

I've looked all up and down my includes/feed-rss2.php, and while I see a lot of stuff that generates my feed, nowhere do I see something that actually queries for a list of posts.我已经查看了所有内容/feed-rss2.php,虽然我看到了很多生成我的提要的东西,但我没有看到任何实际查询帖子列表的东西。 In fact, there is no reference to "query" anywhere in the file!事实上,文件中的任何地方都没有提到“查询”!

Can you direct me to the appropriate place?你能指导我到合适的地方吗? Better yet, if there is some parameter I can stick in the URL when requesting the feed in the first place, that would be great.更好的是,如果有一些参数我可以在首先请求提要时粘贴在 URL 中,那就太好了。

Thanks for any direction you can give.感谢您提供的任何指导。

The simplest way to change the number of posts in your feed is to utilize built in options.更改提要中帖子数量的最简单方法是使用内置选项。

Go to the admin Dashboard, then to Settings, then to Reading. Go 到管理仪表板,然后到设置,然后到阅读。

You will be faced with various options, the most important being:您将面临各种选择,最重要的是:

Syndication feeds show the most recent 10 items联合供稿显示最近的 10 项

That will allow you to specify the number of posts your feed will contain.这将允许您指定您的提要将包含的帖子数量。

Simple, easy and all via the admin panel!简单,轻松,全部通过管理面板!

Source: Settings -> Reading via the Wordpress Codex来源:设置 ->通过Wordpress Codex读取

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM