Plugin Directory

amr shortcode any widget

Include any widget in a page for any theme. [do_widget widgetname ] or [do_widget "widget name" ] [do_widget id=widgetnamedashed-n ]or inc

PLEASE get your widgets working in a sidebar BEFORE activating this plugin, and PLEASE read https://wordpress.org/plugins/amr-shortcode-any-widget/installation/ before asking any questions.

Widget help, the widget is doing this, when it should do that

Please get the widget working first in a normal sidebar without this plugin and ask for support on the widgets forum it is does not work in a normal sidebar. There are 1000's and 1000's of widgets. I cannot help you with all ofthese. Please see http://wordpress.org/support/topic/widget-help-settings-functioning-etc?replies=1

How to identify widget

To identify your widget in the shortcode, use a safe constant identifier like the NAME or the ID.

The name is the generic NAME like "tag cloud".

It is NOT your unique title eg: "Amazing Cloud Of Keywords" which you might change one day while procrastinating about doing real work, idly decide it looks a bit twee and change to "Cloud of tags". That would break the do_widget shortcode and it would not find your widget (if that was the way it worked).

For this reason the plugin deliberately does not allow identification by 'title'. It is not necessary - for simple usage the name is perfectly adequate, for more complicated multi-instance usage, the ID is safer all around.

Also the parameter 'title=' is being used to allow you to change the html tag used around the title (or hide the title), so it would be a tad confusing anyway to offer it and not necessary.

The id is how wordpress identifies the instance of the widget.
To help you find the wordpress id of your chosen widget you can either:

1) enter some garbage in the shortcode [do_widget wtf] and the plugin will offer you a try debug (if you are admin and logged in that is) Click on the "try debug"

2) else add ?do_widget_debug=1 to the url of the page that contains the [do_widget] shortcode.

either way you should see a list of stuff. See the screenshots for examples. It will say something like the widgets in "widgets for shortcode" are: xxx-n xxxxxx-n xxx-xxxxx-n

and it will list the ids of your widget - the n's are numbers that distinguish multiple instances of the same widget. xxx's are the abbreviated names of the widgets.

as per screenshot 5 http://s.w.org/plugins/amr-shortcode-any-widget/screenshot-5.png?r=884849

Those are the ids you should use. They look like this:

meta-3 tag-cloud-2

More info here: http://wordpress.org/support/topic/ids-and-multiple-instances-of-widget?replies=2

Styling, your theme, css, overriding

Yes anything could happen wrt the appearance.(There are 10s of 1000s of themes and widgets. Multiply out the possible combinations. Add in css specifity, inheritance and cascading rules. Consider you are moving the widget out of the sidebar where the the theme and widget plugin expect it to be. ) The effects are very dependent on how your theme has specified the css that may apply to widgets and sidebars/widget areas. It may work beautifully and have the content looking like it belongs with your theme. This plugin tries to help encourage that 'belonging' look. If it fails then it offers ways to switch the html and/or the classes being generated.

Examples: * you may have undesired effects applying that do not work in the main content area * You may have desired effects not applying because the css is specific to a themes sidebar and does not apply to the html in a page.

The plugin can help a bit - Via the plugin you can do the following to affect styling:

  • Remove the general wordpress 'widget' class from the widgets wrapping html and the 'widget_title' from the title html. ([do_widget widgetname widget_classes=none]

  • Hardcode away from your themes html for widgets and widget title. EG: if your theme uses aside and h2, you could specify: [do_widget widgetname widget_classes=none wrap=div title=h3]. By default the plugin will use whatever your first sidebar uses. This will change if you change themes, but only if you have NOT overridden the html with wrap and title.

  • Apply an existing class in your theme. Use [do_widget widgetname class=yourclass].

  • Use the additional class 'amr-widget' provided to specify alternate css in your themes stylesheet or with something like wordpress custom css.

One of the new features is as a default setting is that the plugin will try have your current themes first sidebar styling apply to the widgets inserted into a page via the shortcode.

Many folks requested this, insisting that absolutely this is what should be happening and why didn't it? Well..This could be great - Imagine: a plugin that can pick up the theme styling and change it as your theme changes.

The success of this depends very much on how your theme specifies it's css. Does it always use classes ? - more css will apply. Does it lock the css down by sidebar-id: that css will not apply.

It also depends on what the original widget plugin does with css and js. It may have done something thinking that the widget will always be inside a sidebar and not anticipated being in a page. This the shortcde-any-widget plugin has no control over.

For example: An unwanted effect could be white text on a white background as in the twenty fourteen theme.

** If you have an undesired styling effect with the default settings: **

You need to learn the joys of the 'inspect element' tools in various browsers or browser web developer, firebug add-ons, so you can see what css is applying to what html. Then you can either change some of the html or override or change the css.

Options if you don't like the default result:

Use the 'amr-widget' class that has been added to the widget wrapping html to override any css.

eg: .amr-widget [ color: #000000; }

Tap into a class you already have in your theme:

[do_widget class=yourclass]

Change the html that the shortcode-any-widget plugin will use.

eg: don't like the h3.widget-title styling ? change the title html to h2 in the shotcode parameters

[do_widget title=h2]

eg: don't like the 'aside' wrapping html styling? change the wrapping html:

[do_widget wrap=div]

If you only using widget, maybe inserting the whole sidebar or widgertarea would give an interesting effect. Sidebar background css may apply.

[do_widget_area] More info on background: http://wordpress.org/support/topic/your-theme-your-sidebars-and-the-plugin-overriding?replies=10

Compatible up to: 4.3.1
Last Updated: 3 weeks ago
Active Installs: 50,000+


4.6 out of 5 stars


5 of 6 support threads in the last two months have been resolved.

Got something to say? Need help?


Not enough data

0 people say it works.
0 people say it's broken.

100,3,3 100,1,1
100,1,1 100,2,2 0,1,0 100,4,4 0,1,0
100,2,2 100,1,1
100,2,2 100,1,1
80,5,4 100,2,2 100,1,1
100,2,2 75,4,3
0,1,0 100,1,1