Mayank
Mayank

Reputation: 61

How to get post from specific category using REST api

I am using rest API to get the post from a specific Category. but from this URL http://example.com/wp-json/wp/v2/categories/?slug=category_name I am only getting the category name, not the post.

and by using this link

Check this link

I am getting all the post but not getting the featured image in that post.

note: I am using the better-featured image

Upvotes: 1

Views: 6548

Answers (1)

Jason Van Malder
Jason Van Malder

Reputation: 617

You have to use the category ID. Example: http://example.com/wp-json/wp/v2/posts?categories=3160

Upvotes: 8

Related Questions