WordPress provides various REST API methods to use WordPress in new and exciting ways, such as creating Single Page Applications on top of WordPress. You would not even have to write the applications in PHP: any programming language that can make HTTP requests and interpret JSON can interact with WordPress through the REST API, from Node.js to Java and beyond.
WordPress REST API To List Posts :
For listing posts from the WordPress REST API, WordPress provides the below endpoint,
With this endpoint you can get the lists of posts and we can also do manipulation on the response by passing the arguments on the endpoint like,
You can check on the WordPress Official REST API Handbook for more arguments that can be used on the URL.
Example Requests :
$ curl https://niralar.com/wp-json/wp/v2/posts
$ curl https://niralar.com/wp-json/wp/v2/posts?per_page=20
Source Code :
Code Snippet gets the list of posts from Niralar through cURL In PHP, Where your listing the posts outside the WordPress platform with your custom UI desing.
You can checkout the demo here
Please leave your valuable comments/suggestions/feedback on below comment box if any.
Thank You !!