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
Swear Trek

Wait what?

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.

Add to Reusable Blocks

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.

Image of Google Map’s iframe code  for San Dimas California.

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.

  1. My favorite solution is to use WP_Query and JavaScript to rotate through a preset series of media files or posts.
  2. 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.

  1. I hard coded everything into sidebar.php! The image carousel, call to action, and the Google Map embed.
  2. Instead of properly enqueuing a jQuery script I placed that in a template somewhere.
  3. 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.

Final note.

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.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.