WordPress.org

Ready to get started?Download WordPress

Plugin Directory

amr shortcode any widget

Include any widget in a page for any theme. [do_widget widgetname ] or [do_widget "widget name" ] or include a whole widget area [do_widge

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

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

Need more instruction: As per step 7 on the front page: To find the 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 where the [do_widget] shortcode is

either way you should see a list of stuff. 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 instanaces 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

Check your styling. 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. 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.

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 addition 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 effect with the default setings:

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: 3.9.2
Last Updated: 2014-8-2
Downloads: 81,581

Ratings

4 stars
4.8 out of 5 stars

Support

3 of 9 support threads in the last two months have been resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

1 person says it works.
0 people say it's broken.

100,1,1
100,1,1
0,1,0
100,1,1
100,1,1
100,1,1
0,1,0
100,2,2
100,1,1
0,1,0
0,1,0
100,3,3
100,1,1
100,3,3 100,1,1
100,1,1 100,2,2 0,1,0 100,4,4 0,1,0
100,1,1
100,2,2
100,1,1