I wrote about making a WordPress ajax theme several years ago, using only jQuery and some small piece of Javascript. While the whole idea is still the same, there is probably a better way to do that with REST-API in WordPress 4.4, which was just released yesterday.
This technique is covered by Rachel Baker in the WordCamp US 2015. Here is the full video:
http://wordpress.tv/2015/12/09/rachel-baker-build-a-theme-with-the-rest-api/
If you want to have a quick look at the content, then here is the slides:
https://speakerdeck.com/rachelbaker/utilizing-the-wp-rest-api
The whole technique is fetching posts by making a request to your WordPress website using REST-API and dynamically update the DOM. She's using UnderscoreJS for templating and Director for routing. This talk is really inspiring as it opens limitless possibilities to make themes. Note that REST-API powered themes are allowed in the WordPress.org repository.
Of course, there are some issues that we must care about such as caching, SEO, widgets, comments and plugins. But the technique is really interesting because you can use a WordPress ajax theme for:
- Mobile apps
- Separate your website frontend (view) from the backend and host the frontend elsewhere
- Improving user experience
This is just the starting point of an interesting trend in the very near future. And I'm curious how it goes.
You might want to check out other videos from WordCamp US 2015 here, they are so valuable and worth your time.
Leave a Reply