WordPress is a like a free buffet. You can do a lot very cheaply; but if you don’t know what you’re doing it will cost you later. 💩— Joseph Dickson
I said this mockingly in a reply on Twitter, knowing a few friends would see it pop up in their feeds. WordPress is a fantastic content management system whether you’re hosting a website to blog, serve a small business website or a large enterprise.
Where it gets tricky is how you use it.
I remember my first “real” WordPress project. It began as a simple blog with a custom background and footer designed to chronicle a short term event. Very soon after launch several new features needed to be added. A call to action an embedded Google map and eventually an image carousel.
Today a repeated call to action message is very easy to accomplish, any Gutenberg block or group of blocks can be saved as a Reusable Block. (While block is selected click three vertical dots menu and select Add to Reusable Blocks.)
Likewise a Google Map can be embedded by pasting the iframe code into an HTML Block. At some point I expect Google Maps will have its own block.
The final piece, an image carousel isn’t currently offered among the default blocks but this can be created accomplished several ways; I prefer using a child theme for most projects as it can hold multiple features in a single package while it’s parent can receive updates from the upstream developers.
- Building a custom Gutenberg block is an even better solution, I just need to learn how to accomplish it 😀
What went wrong with that project?
I wish I can say it was just one thing; I was new to WordPress development and made several rookie mistakes.
- I hard coded everything into sidebar.php! The image carousel, call to action, and the Google Map embed.
- Instead of properly enqueuing a jQuery script I placed that in a template somewhere.
- Additionally selected a few inflexible and poorly designed plugins.
All required my attention to make edits and unsurprisingly the poorly planned site began to break. Eventually I had to make the decision to either rebuild it from scratch or delete the site entirely.
By hard coding all these elements I bypassed the best feature of WordPress, allowing users update content freely with minimal effort. Likewise, relying on poorly maintained plugins to accomplish a simple task became an additional time commitment to maintain. The shortcuts helped me turnaround the site quickly but created a maintenance nightmare over the following year.
Don’t be intimidated by theme, plugin, and block development. The more we learn allows us to develop faster and cleaner code which in turn creates flexible sites that are easier to maintain.