I need to display the latest post with a specific tag.
Example: User tags a post ‘featured’, but forgets to untag earlier posts.
So I want to ensure that the latest post tagged ‘featured’ is what displays on other sites.
https://my-site.com/wp-json/wp/v2/tags/&filterbylatestdatesomehow
1
You can actually find extensive documentation on wordpress.org.
But let’s have a look at this particular example:
https://demo.wp-api.org/wp-json/wp/v2/posts?per_page=5&tags=3
The 5
in there is the number of posts you want returned.
The 3
is the id of the tag you want to limit the posts too.
If you want to limit to a category use categories
instead. But you’d have figured that out yourself after looking at the documentation, right? 😉