March 2020
Beginner
660 pages
18h 28m
English
We started this recipe by adding a shortcode to display a list of posts. Inside the shortcode callback function, we used the wp_remote_get function with the following URL: http://www.yoursite.com/wp-json/wp/v2/posts?_fields=author,id,excerpt,title,link. wp_remote_get is a WordPress-specific function that's used to retrieve results from HTTP requests using the GET method. The URL requested in the wp_remote_get function is the REST API request. In this URL, wp-json is the main API route. wp/v2 refers to version 2 of the WordPress REST API.
In this request, we are requesting ...
Read now
Unlock full access