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

✏ How to Avoid SEO Disaster, 6 Types of Web Design, Simply Markdown, and more...

Sunday, June 20, 2021

Work at the Intersection of Data, Design, and Technology [ad] SPS.NORTHWESTERN.EDU An Alternative Voice UI to Voice Assistants SMASHINGMAGAZINE.COM COMMENTS Simply Markdown - Easy Create Markdown with

✏ Is AMP Dead and Do We Care? React Markdown Editor, Bad vs Good Designs, and more...

Saturday, June 19, 2021

Poll: Is AMP Dead, and do We Care? WEBDESIGNERDEPOT.COM COMMENTS Bad Vs Good Accessible Designs USABILITYGEEK.COM COMMENTS Client-Side Routing in Next.js SMASHINGMAGAZINE.COM COMMENTS React Markdown

The 25 Best Accent Chairs, According to AD100 Designers

Friday, June 18, 2021

Plus, more sourcing inspiration. View in your browser | Update your preferences Architectural Digest AD PRO logo image Welcome to the PROcurement, our new weekly roundup of the best designs to source

✏ 40 Javascript Memes, CSS Specificity Calculator, HTML Semantic Tags Sheet, and more...

Friday, June 18, 2021

The Problem with UX/UI Portfolios MARKBOULTON.CO.UK COMMENTS CSS Specificity Calculator POLYPANE.APP COMMENTS Your Image is Probably not Decorative SMASHINGMAGAZINE.COM COMMENTS Top 40+ Javascript

What Will Back-To-Normal Look Like?

Friday, June 18, 2021

A weekly dispatch from Architectural Digest's Editor in Chief. ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌

UX/UI Portfolios, Feels, Bear Plus Snowflake, Optical Size, Aspect Ratio

Friday, June 18, 2021

The 5 best design links, every day. Curated by a selection of great editors. Email not displaying properly? View browser version. Sidebar June 18 2021 The problem with UX/UI portfolios markboulton.co.

RWD Weekly #462— the one about the little yellow book

Friday, June 18, 2021

No preview text for you this week, you've got to commit to reading this one by opening it first :) Read online Hello again, welcome back to RWD Weekly #462 happy Friday! This week I've been

Meet Image Optimization, A New Smashing Book

Thursday, June 17, 2021

Meet Addy Osmani's new book on image optimization: from formats and compression to delivery and maintenance. Brand new book: Image Optimization by Addy Osmani. Dearest Friend, How do we deliver

🔥 Dashing Mobile UI Designs and more

Thursday, June 17, 2021

Round Up The Newest UpLabs Weekly Freebies 🤠 Check out some fresh high-quality Freebies that have been handpicked for you by the UpLabs team this week. The New Super Fast Way to Build a Website

Holly Hunt Reinvents Herself Once Again

Thursday, June 17, 2021

Plus, a houseplant sells for almost $20000 at auction (image) Architectural Digest AD PRO Logo house plant - philodendron Think You Love Houseplants? This One Just Sold for Almost $20000 Read More →