A demonstration theme.
I’ve pushed a demo WordPress theme to GitHub to let the code speak. In an effort of laziness below is the README file contents and a movie. Because we all love movies.
REST Query Demo Theme
- Download the theme
.zipfile and extract it in your local WordPress theme folder or clone it there:
git clone https://github.com/lucatume/rest-query-demo-theme.git
composer updatefrom the theme root folder.
- Make sure the following plugins are installed and active on the site:
- WP REST API plugin
Make sure your local installation is running PHP 5.4 or above.
Activate the theme.
The relevant part of the theme is the code used to render the content loop initial state using handlebars.php and the following refresh using Backbone and Handlebars.js. The template re-use possibility comes from a “RESTified”
I’d say more test coverage on the REST Query plugin.