I am preparing for an exam and i am struggling with this question. Please help
Suppose you have a non-WordPress video compressor PHP website with a WordPress instance in the “/blog/” folder. How can you show a list of the last 3 posts in your non-WordPress pages?
I believe the WP REST API v2 way to do this is to call:
https://domain.tld/folder/wp-json/wp/v2/posts?per_page=3&tags=3
…from your non-WordPress PHP website.
per_page=3
…is the number of posts you want to call.
tags=3
…is the WP ID of the tag you want to display.
If you wanted to call a category instead of a tag, you’d simply state:
category=3
…in place of tag.
Anyone else want to add to this; or correct it
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.