【发布时间】:2015-09-26 03:03:34
【问题描述】:
我可以通过https://public-api.wordpress.com/rest/v1/sites/www.website.com/posts/ 来查看 WP 网站上最新的 20 个帖子。
如何查看超过 20 个?或者查看所有帖子?
【问题讨论】:
我可以通过https://public-api.wordpress.com/rest/v1/sites/www.website.com/posts/ 来查看 WP 网站上最新的 20 个帖子。
如何查看超过 20 个?或者查看所有帖子?
【问题讨论】:
如documentation for GET /sites/$site/posts/ 中所述,只需在查询字符串中包含适当的number 和page 参数即可。
查看前 100 个:
https://public-api.wordpress.com/rest/v1.1/sites/en.blog.wordpress.com/posts/?number=100&page=1
查看第二个 100:
https://public-api.wordpress.com/rest/v1.1/sites/en.blog.wordpress.com/posts/?number=100&page=2
等等
【讨论】: