Whenever you’ve entered identical content in more than one place in your WordPress Web site, have you wished there was a better way?
Well, there is.
There’s a plugin for that!
There’s a plugin for that: the amr shortcode any widget WordPress plugin.
Description from the WordPress repository:
Here’s how it works, in a nutshell:
As soon as you install and activate the plugin, the contents of any widget you create (and already created) can be displayed virtually anywhere on your site by using a special shortcode.
Let’s look at a few simple examples
1. Call-to-Action buttons
If you’re not including calls-to-action on your Web site, you should. And not just in sidebar widgets. You probably should be placing them within the content area of various pages, maybe even multiple times in a single page.
For example, if you’re presenting benefits of a product or service, include a call-to-action button after each benefit, like so:
2. Company address
It’s common to display a company address in the footer of a site and also in the body of the Contact page.
3. Affiliate disclosure
If you have affiliate relationships with businesses whose products or services you review, endorse, recommend, etc. on your site, you’re required by law to display an appropriate disclosure. One way to meet your legal requirement to place a disclosure on any page or post related to one of those products or services, like so:
Does this sound familiar?
If you’re thinking this sounds a lot like how you would insert a Gravity Forms form or a TablePress table — or content elements from any number of plugins you’ve used — into a page, post, or widget, then you’re on the right track. Essentially, the amr shortcode any widget plugin lets you create a master content element and then insert instances of that content element wherever you want.
Furthermore — and this is probably the greatest feature of the plugin — if and when you update the master element, all instances of that element are automatically updated.
So, if you want to change the text of your call-to-action button, or your address changes, or you want to modify your affiliate disclosure, simply modify the master content element, and all the instances will be updated!
How to use the amr shortcode any widget WordPress plugin
1. Install and activate the plugin.
Two things will happen immediately:
a. Every widget you previously added to a widget area will be assigned a shortcode with a unique ID. That ID will be comprised of the widget type and a unique number. Here are screen shots of a Navigation Menu widget and a Meta widget, both previously entered into a main sidebar:
b. A new widget/sidebar area, called Widgets for Shortcodes will be added:
2. For inserting an existing widget into a page, post, or other widget area:
Simply copy the unique
do_widget shortcode and paste it where you want the content to appear. So, if for some reason you wanted to display the “Meta” widget content in the content area of a page or post, you would simply enter this:
3. For inserting content that is not already in a widget — and that you don’t want to appear in any standard widget area:
Let’s say, for example, that you want to insert instances of the Affiliate Disclosure content in various pages and/or posts but do not want to have it appear in any of the standard widget areas. Just drag a Text (or Custom HTML) widget to the Widgets for Shortcodes widget area, add the content you desire, and save it. After saving that widget, it will be assigned a shortcode with a unique ID. Then insert that shortcode wherever you want, just as above.
Note: The plugin author recommends that you add the widget to a normal sidebar/widget area first, check to make sure it works, and then drag it to the Widgets for Shortcodes widget area. Not a bad idea, but not required.
But wait, there’s more!
A very cool feature of the amr shortcode any widget plugin is that you can use the plugin to insert widgets that themselves include shortcodes!
“When would I want to do that?” you ask.
I’m glad you asked.
The simplest example that comes to mind is if you want to embed a WordPress image gallery in multiple locations — especially if you intend to modify that gallery over time.
The WordPress gallery feature generates a shortcode which, in its simplest form, looks like this:
If you were to insert that shortcode into all of the pages where you want the gallery to appear, you’d be in trouble when you add or delete images to/from the gallery. Namely, you’d have to go back into all of those pages and edit the list of IDs.
Instead, create a simple text widget containing the above gallery shortcode in the Widgets for Shortcodes widget area, save it, and insert the new amr do_shortcode shortcode into those pages. Thereafter, when you need to change what’s in the gallery, simply modify the image ID listing in the Widgets for Shortcodes widget area, and the gallery will automatically be updated in all of the pages.
I’d love to hear from you if you have other ideas about how to use the amr shortcode any widget plugin. Also, of course, I’ll be happy to answer any questions you have.