[英]How to change the number of posts that Wordpress JSON Api loads per page
如何更改每页WordPress JSON API加载的帖子数。
默认值为25,由于互联网连接速度太慢,我想减少它。
如文档中所述 ,您可以在请求中使用count
参数指定响应中的最大帖子count
。
配置了用户友好的永久链接的示例:
http://www.example.org/api/get_posts/?count=10
如果您使用的是较新的WordPress版本,则根据他们的文档
https://developer.wordpress.org/rest-api/reference/posts/#arguments
现在使用了per_page
参数。
https://www.example.org/api/get_posts/?per_page=100
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.