最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

taxonomy - WP REST API not retrieving all categories

programmeradmin0浏览0评论

I am developing a project that is using the WP REST API. After some tests, I realized that it's not retrieving all the categories based on what I am trying to GET. In precise, there are supposed to be 21 results but only 10 come up. Is there some kind of restriction that I am not seeing? Any settings that I'll have to change.

Here is what I am trying:

TIA

I am developing a project that is using the WP REST API. After some tests, I realized that it's not retrieving all the categories based on what I am trying to GET. In precise, there are supposed to be 21 results but only 10 come up. Is there some kind of restriction that I am not seeing? Any settings that I'll have to change.

Here is what I am trying:

https://example/wp-json/wp/v2/categories?parent=97

TIA

Share Improve this question edited Jul 21, 2020 at 17:47 abhivemp asked Jul 21, 2020 at 17:38 abhivempabhivemp 1135 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 2

As documented, the default number if results returned "per page" is 10. So you need to set per_page to however many you want to retrieve:

https://example/wp-json/wp/v2/categories?per_page=30
发布评论

评论列表(0)

  1. 暂无评论