A basic example of fetching posts with the WP API

Andy Adams offers a simple example on CSS Tricks for fetching a random post with the click of a button, using the WordPress REST API.

His example is similar to how I run the ad system on Post Status (I use an iframe that doesn’t run WordPress, and call the ads as a CPT, using AJAX inside the iframe).

If you’re looking for a nice introduction to using the API, I think this is a solid place to start.

Similar Posts