admin管理员组文章数量:1335604
How do I exclude a particular category in the API?
For all categories - I may use the following:
/?rest_route=/wp/v2/posts&per_page=100
What if I need across all the categories except for category-10?
I am using JavaScript at the front.
Thanks
How do I exclude a particular category in the API?
For all categories - I may use the following:
https://www.example/?rest_route=/wp/v2/posts&per_page=100
What if I need across all the categories except for category-10?
I am using JavaScript at the front.
Thanks
Share Improve this question asked May 28, 2020 at 14:26 newnew 214 bronze badges1 Answer
Reset to default 1I just figured it out, just in case it might be helpful for anyone in future:
There is an option available to exclude a particular category - categories_exclude
So, the new rest API would be:
https://www.example/?rest_route=/wp/v2/posts&per_page=100&categories_exclude=10
本文标签: postsexclude particular category in api
版权声明:本文标题:posts - exclude particular category in api 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742392997a2466362.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论