How to run Wordpress in 2020 (and not like it's 2012)

BCN

$$$$ ¯\_(ツ)_/¯ $$$$
Joined
Dec 26, 2015
Messages
261
Likes
270
Degree
1
Hi,

So as everybody knows, Wordpress development sucks. It's ancient code, hard to commit to version control, hard to combine with a modern frontend dev setup, no way out of the box to deal with dev/staging/production, and it doesn't conform to modern PHP dev.

I've been playing with this lately Roots Bedrock, along With Roots Sage.

Bedrock allows you to run Wordpress in a more sensible way. It allows you to use composer to maintain dependencies, and it's a much more sensible file structure. I really like the concept of mu-plugins, i.e. you can add short "plugins" (a single file) that registers post types, removes bloat or anything else, and they don't need all the scaffolding of regular Wordpress templates. So you can move logic out of the theme.

Sage is a starter theme where you can run yarn and compile down your files (SASS instead of CSS etc.) It also has Blade syntax, partials ++ It also has controllers, so you can pass data from WP into your views in a more sensible way.

So far I've used it with tailwind css. And I've made some sites using Advanced Custom Fields with multiple custom post types.

I'm not going to write a ton here, but check out the docs.

https://roots.io/sage/
https://roots.io/bedrock/

Trust me, it will make you hate Wordpress less.
 
I really like the concept of mu-plugins, i.e. you can add short "plugins" (a single file) that registers post types, removes bloat or anything else, and they don't need all the scaffolding of regular Wordpress templates. So you can move logic out of the theme.

Must Use Plugins are a native part of Wordpress, just in case anyone likes the idea and wants to pursue it and thinks they need to learn a lot of this other stuff.

I don't use this currently, but have looked into it. Like you said, you can dump a ton of your own customizations you do to every site into one plugin and call it a day. Basically a plugin full of functions.php functions.

If I was doing a lot of client sites or even a lot of my own, I'd def look into it as a scalable launch pad. You can have your own theme skeleton, base CSS all normalized and everything, your mu-plugin with all of your security stuff and anything else, all of your other plugins installed, and then export the whole thing as a zip with a database. Setting up new sites could be done in minutes and you'd be well ahead of your own game doing that.
 
I guess the main thing that appeals to me is that I'm used to Laravel, and this setup resonates well with me. Just stuff like using webpack, building sass and removing unused stuff -- sort of like laravel mix -- is nice to have in a "framework", as it doesn't fit well in with Wordpress' normal workflow.

I'm currently launching around 15 sites in the coming months, and I think this will save me time and make it more structured.

Edit: I didn't know mu plugins were a part of Wordpress natively.
 
I'm currently launching around 15 sites in the coming months, and I think this will save me time and make it more structured.
What kind of sites are you launching. Affiliate? SaaS? 15 is quite sth.
 
Affiliate. I'm 95% media buying, but figured it's time to get some more residual income too, since mediabuying is a rollercoaster.
 
Another note: I'm testing to add vuejs to Sage, and it's pretty easy as it comes with webpack and all that good stuff. I want to use it to make some slider filters and other simple stuff.

I don't know enough JS to fully build a SPA and run Wordpress headless. I've made some SPA without WP, but I really just know JS/vue well enough to use it like how you'd use Jquery - to make small things here and there and make the site more interactive.

It's one of my goals though.
 
Bit late to the party here but I am enjoying using Nuxt on the front end connecting to either a express api or laravel api. Nuxt has an option for Server Side Rendering and is built onto of vuejs so if you are familar with vue you should be good to go with Nuxt except for a few rare occasions where things are slightly different due to the fact you don't always have access to the window object of the browser in nuxt as the pages are server side rendered but the work arounds are well documented.
 
Nice, I've been playing with Nuxt for static pages. Wanted to test to connect it to Wordpress REST API.

Testing some stuff for fun with Nuxt and Airtable this weekend when I have time. :smile:
 
Back