Re:Tonik — WordPress starter theme with CLI, ES6, Webpack an...
by fimdomeio on Thursday July 06, 2017 @09:21AM
(#14710152)
I started separating the admin from the "theme" by using the wordpress rest api (admin running in a subdomain). While this might seem overkill at first but I find that there's a lot less documentation to read and I can reuse a lot more code from other projects without any changes.
[ Parent
| on HN ]
Re:Tonik — WordPress starter theme with CLI, ES6, Webpack an...
by _neil on Thursday July 06, 2017 @12:17PM
(#14711479)
I love using the rest API like this. The main downside is you lose the inability to use many Wordpress plugins.
I.e., if your users want to insert a poll into a page, before you could probably install a plugin that integrates with the editor and admin panel. With this approach, you'll (probably) need to build that functionality yourself. So, your content and users need to be just right to do this.
Re:Tonik — WordPress starter theme with CLI, ES6, Webpack an...
by Already__Taken on Thursday July 06, 2017 @09:48AM
(#14710357)
Most of my WP sites don't do a lot. Can you use the rest API to handle the contact form and search? that was I could just use a static generation from wp itself. The wp admin wouldn't even need to be publically accessible then.
Re:Tonik — WordPress starter theme with CLI, ES6, Webpack an...
by sanat on Thursday July 06, 2017 @10:34AM
(#14710696)
The WP API handle search but not contact forms. Most plugins still don't provide you with an API.
Contact form 7's latest build has them using their own API - but it's still undocumented.
Re:Tonik — WordPress starter theme with CLI, ES6, Webpack an...
by bluetidepro on Thursday July 06, 2017 @09:30AM
(#14710224)
Do you have any detailed notes on how you set this up? I haven't used WP in a long time, to be honest, so not sure how their rest api works? Is it straight forward? Would love to read about this setup you do, sounds great.
Re:Tonik — WordPress starter theme with CLI, ES6, Webpack an...
by rmccue on Thursday July 06, 2017 @09:36AM
(#14710268)
The REST API is included with WordPress 4.7+ and on by default. Docs here: https://developer.wordpress.org/rest-api/ (if you find anything missing, I'd love to know)
Re:Tonik — WordPress starter theme with CLI, ES6, Webpack an...
by yellowboxtenant on Thursday July 06, 2017 @10:31AM
(#14710676)
I can't picture developing WP themes without WP_Query class. Does that ever pose a problem for you?