How To Insert Custom WordPress Plugin and Widget into any WordPress Post or Page

Screen Shot 2014-10-14 at 4.02.55 PMHave you ever wondered how to create a custom WordPress plugin and a custom WordPress widget, and you want to be able to embed your new custom WordPress widget in any page or post? If so, you my friend have come to the right place.

Keep reading and you will learn how to install a custom WordPress plugin and a custom WordPress widget. You will also learn how to insert aforementioned custom WordPress widget into any WordPress post or page.

To show you how to do all of this, install a this WordPress plugin called percentager. Just download it, clone it, fork it, or whatever from Github.

If you’re cloning, in your wp-content/plugins directory run this:

git clone https://github.com/hack3r3d/percentager.git

Obviously if you forked it, you need to change the URL.

Let’s digress for one second. Why are we installing a WordPress plugin called “percentager”?

Figuring out the percent different between two numbers is something I have to do often. Embarrassingly, I have to think about how to do it for a minute. I can always come up with the correct answer, but it takes me longer than I think it should.

So instead of waiting to get smarter, I just created this little WordPress plugin and a custom WordPress widget, shown here.

Percent Change Calculator

The difference between X and Y is a Z

This WordPress custom plugin consists of the following files.

Your percentager.php file should look like this.

With the percentager custom WordPress plugin installed and activated, let’s add it to a post. You activated it right? If not, do that before continuing.

To add the percentager custom WordPress widget to a post or page, you have to install AMR Shortcode Any Widget. Do that.

Once you have the AMR Shortcode Any Widget installed and activated, go to Appearance -> Widgets. There you will now see “Widgets for Shortcodes.” You should also see the Percentager widget. Drag Percentager onto the “Widgets for Shortcodes” box.

Now Percentager is available to be included in a posts and pages.

Create a post and add this to the body in Text mode.

[do_widget Percentager]

If you did everything correctly, and I didn’t mess up my instructions, you should see the Percentager widget in your new blog post. It’s a great way to customize pages and posts with custom WordPress plugins and widgets.

I hope you enjoyed this post. If you need help customizing your WordPress site, I’m available for hire, send me a message.

Share Button