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

BCN

$$$$ ¯\_(ツ)_/¯ $$$$
Joined
Dec 26, 2015
Messages
245
Likes
252
Points
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.
 

Ryuzaki

お前はもう死んでいる
Staff member
BuSo Pro
Digital Strategist
Joined
Sep 3, 2014
Messages
4,372
Likes
8,425
Points
8
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.
 

BCN

$$$$ ¯\_(ツ)_/¯ $$$$
Joined
Dec 26, 2015
Messages
245
Likes
252
Points
1
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.
 
Joined
Jan 26, 2015
Messages
142
Likes
34
Points
0
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.
 

BCN

$$$$ ¯\_(ツ)_/¯ $$$$
Joined
Dec 26, 2015
Messages
245
Likes
252
Points
1
Affiliate. I'm 95% media buying, but figured it's time to get some more residual income too, since mediabuying is a rollercoaster.
 
Joined
Mar 28, 2019
Messages
69
Likes
66
Points
0

BCN

$$$$ ¯\_(ツ)_/¯ $$$$
Joined
Dec 26, 2015
Messages
245
Likes
252
Points
1
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.
 
Joined
Nov 5, 2015
Messages
24
Likes
24
Points
0
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.
 

BCN

$$$$ ¯\_(ツ)_/¯ $$$$
Joined
Dec 26, 2015
Messages
245
Likes
252
Points
1
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: