Speckyboy RSS: How a Custom WordPress Plugin Can Help You Manage a Website

Your latest Speckyboy content is here!.

Speckyboy Design Magazine

Design News, Resources & Inspiration

How a Custom WordPress Plugin Can Help You Manage a Website


By Eric Karkovack on Mar 28, 2021 05:08 pm


Whether you’re a WordPress user or build websites for a living, it’s likely you’ve relied on a few plugins along the way. These additional pieces of software enable the content management system (CMS) to perform new and exciting functions. Everything from contact forms, shopping carts to SEO are just a few clicks away.

Even better is that it’s possible to build your own custom WordPress plugin. And, no, it doesn’t have to be anywhere near the scale or depth of big players like WooCommerce or Jetpack. Nor do you have to be an expert in PHP or JavaScript (though some working knowledge helps).

In fact, some of the best reasons to build a custom WordPress plugin aren’t about adding major functionality. They’re more about making your website easier to maintain over the long term. Things that will save you from problems when you switch to a new theme or hand off a site to a client.

That’s only scratching the surface of what a custom plugin can do. To help demonstrate their power and convenience, here are some situations where building a custom WordPress plugin can be a big help.

How Do You Build a WordPress Plugin?

Before we get into the scenarios of why a custom WordPress plugin could make sense for your project, you may be wondering how to go about building one. That’s a pretty deep subject.

There are tons of reference materials and tutorials out there that cover the specifics. Therefore, we won’t go into great depth here.

Instead, we’re going to point you to the WordPress Plugin Handbook – which is the best place to start. It provides all the background information you need to get your project moving forward. In particular, check out the Plugin Basics section, as it will show you the required first steps.

It’s also worth checking out the Hello Dolly plugin that’s included with a default WordPress installation. The entire plugin is contained within a single PHP file. Its simple structure could serve as an inspiration for your own creation.

In addition, you will want to check out the following resources for getting the most out of your custom plugins:

The WordPress Plugin Handbook home page.

Scenario #1: Making Customizations That Survive a Theme Change

So often, WordPress code tutorials mention that you can add a snippet to your active theme’s functions.php file. Why? Because it’s often the easiest path forward for both the writer and the reader.

That doesn’t make it the best solution, however. Think, for example, of a custom WooCommerce hook that displays some text at the bottom of every product page. This little bit of code will work just fine while residing in your theme – but what happens after a redesign?

Switching themes means losing that customization – unless you remember to copy it over to your new one. A more likely scenario is forgetting about that snippet and scrambling to put it into your new theme after you realize it’s missing.

A plugin removes this potential issue because it’s completely separate from your theme. You can switch themes to your heart’s content and that functionality will still be there.

WordPress Themes page.

Scenario #2: When Functionality Has to Travel Between Websites

Building WordPress websites usually means that you’ll eventually need to use the same functionality in multiple places. That could be adding customer support info to each site you manage or even sharing custom post types across a multisite installation.

With the advent of the Gutenberg block editor, custom blocks are also a prime use case. While some blocks may be client-specific, others could be more general purpose. Placing your blocks into a plugin makes them highly portable.

A custom plugin can be a lifesaver in these situations. You don’t have to reinvent the wheel over and over. Instead, the functionality you need is included in a single package. Just install, activate and move on.

However, this is a good time to bring up the subject of plugin maintenance. If you utilize the same custom plugin on multiple websites, you’ll need to have an effective way to update the code when needed. Version control systems such as Git can come in handy for this task.

While that’s a subject for another day, it’s important to think about before you install your plugin on multiple websites. The more places a plugin resides, the harder it is to maintain without some form of automation.

A collection of suitcases.

Scenario #3: Enhancing an Existing Plugin

Many WordPress plugins offer support for various hooks and filters – code that allows you to change or expand its output and functionality. Think of the WooCommerce example mentioned above as one potential use.

These customizations can play a vital role in how specialized projects such as eCommerce or membership sites work. Placing them into a custom plugin can help in a number of ways.

Beyond the aforementioned separation from your theme, a custom plugin will also allow for better organization. Having all of your code snippets in a single spot means never having to search around for them when it’s time for a change.

Then there’s the ability to add on new functionality down the road. As your website evolves, you may want to build further enhancements. Add them to your custom plugin rather than hacking away at your theme.

Of course, there are also times when a trusted third-party plugin is no longer a viable option. Whatever the reason, you can easily deactivate your custom plugin or remove the additional code you wrote when that time comes.

A electrial plug near an outlet.

A Well-Organized Way to Add Functionality

Before you add custom code directly to your WordPress theme, think about its purpose. While it’s a good place for theme-specific items, other types of functionality really don’t belong in your functions.php file.

For everything else, a custom plugin is the better option. It provides a separate space to store vital functions while keeping them well-organized. You’ll even be able to switch to a new theme without losing your hard work.

The result is a website that is easier to maintain, along with functionality that can be quickly replicated for use elsewhere. It’s a great way to level up your WordPress development workflow.

The post How a Custom WordPress Plugin Can Help You Manage a Website appeared first on Speckyboy Design Magazine.



Read in browser »

Recent Articles:

Weekly News for Designers № 585
Waking Up the Taste Buds of Your Design Clients
Are Google’s Core Web Vitals Metrics Unreasonable?
8 Common Website Layouts Built with CSS Grid
Weekly News for Designers № 584
Share
Tweet
+1
Share
Forward
Copyright © 2021 Speckyboy Design Magazine, All rights reserved.
You signed up for daily Speckyboy Design Magazine email alerts either via Feedburner or directly through our site.

Our mailing address is:
Speckyboy Design Magazine
27 Braeside Park
Inverness, Scotland IV2 7HL
United Kingdom

Add us to your address book


Want to change how you receive these emails?
You can update your preferences or unsubscribe from this list.

Older messages

Speckyboy RSS: Weekly News for Designers № 585

Friday, March 26, 2021

Your latest Speckyboy content is here!. Speckyboy Design Magazine Design News, Resources & Inspiration Weekly News for Designers № 585 By Speckyboy on Mar 26, 2021 10:48 am Envato Elements 100

Speckyboy RSS: Waking Up the Taste Buds of Your Design Clients

Wednesday, March 24, 2021

Your latest Speckyboy content is here!. Speckyboy Design Magazine Design News, Resources & Inspiration Waking Up the Taste Buds of Your Design Clients By Addison Duvall on Mar 24, 2021 07:18 am One

Speckyboy RSS: Are Google’s Core Web Vitals Metrics Unreasonable?

Tuesday, March 23, 2021

Your latest Speckyboy content is here!. Speckyboy Design Magazine Design News, Resources & Inspiration Are Google's Core Web Vitals Metrics Unreasonable? By Eric Karkovack on Mar 23, 2021 08:15

Speckyboy RSS: 8 Common Website Layouts Built with CSS Grid

Monday, March 22, 2021

Your latest Speckyboy content is here!. Speckyboy Design Magazine Design News, Resources & Inspiration 8 Common Website Layouts Built with CSS Grid By Eric Karkovack on Mar 21, 2021 05:42 pm Among

Speckyboy RSS: Weekly News for Designers № 584

Saturday, March 20, 2021

Your latest Speckyboy content is here!. Speckyboy Design Magazine Design News, Resources & Inspiration Weekly News for Designers № 584 By Speckyboy on Mar 19, 2021 07:43 pm Envato Elements The 20

You Might Also Like

The Books AD Editors Can’t Put Down Right Now

Friday, November 15, 2024

View in your browser | Update your preferences ADPro Good Reads Here at AD PRO, we're all about celebrating a good coffee table book. With crisp project imagery and behind-the-scenes stories tucked

What astrology has to do with PR?

Wednesday, November 13, 2024

and, no we won't tell you to read your chart! ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏

#482: New Front-End Techniques

Tuesday, November 12, 2024

With high-definition colors, virtual keyboard on mobile, CSS and reliable dialog in HTML. Issue #482 • Nov 12, 2024 • View in the browser Smashing Newsletter Hej Smashing Friends, I remember the good

Mayer Rus on a Malibu Scouting Mission Gone Right

Tuesday, November 12, 2024

View in your browser | Update your preferences ADPro California Dreamin' I should bring my passport, I always think whenever work demands that I leave my cozy nest in Silver Lake to scout a house

Accessibility Weekly #422: Designing Against the Deaf Tax

Monday, November 11, 2024

November 11, 2024 • Issue #422 View this issue online or browse the full issue archive. Featured: Designing against the deaf tax "'Your baby has failed' isn't a phrase any parent wants

Slow Productivity

Sunday, November 10, 2024

Issue 220: Reflections on the new Cal Newport book ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏

Introducing Brand Presets for Email Templates – Available on All Plans

Saturday, November 9, 2024

Postcards email builder update: mantain your Brand Style across all templates.͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌

Here’s Every 2025 Color of the Year (So Far)

Thursday, November 7, 2024

View in your browser | Update your preferences ADPro Mood of the Moment Color experts are to autumn what Michael Bublé is to the holidays—re-emerging annually in full force to spread seasonal cheer.

Martha Stewart, the Queen of Reinvention

Tuesday, November 5, 2024

View in your browser | Update your preferences ADPro At the book signings for her debut tome, the now-iconic Entertaining published by Clarkson Potter in 1982, Martha Stewart would autograph the inside

#481: Front-End Techniques

Tuesday, November 5, 2024

With text balancing, exclusive accordions, CSS-only validation, responsive video and audio. Issue #481 • Nov 5, 2024 • View in the browser Smashing Newsletter Hej Smashing Friends, As we keep searching