0

I want to display all categories including 3 posts each of it, so will be like this

Cat_A
-post_1
-post_2
-post_3

Cat_B
-post_1
-post_2
-post_3

etc

is it possible to get an example of 3 posts from each category with only 1 WP REST API endpoint?

because if i request api for each category using http://www.example.com/wp-json/wp/v2/posts?categories=1, will be a lot, example 10 categories, then i have to call the API 10 times. if I try to get all posts to filter, i think is not the best way because if posts already got 10k articles, it will slow down performance.

any recommend? thank you

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.