WordPress.org

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

  1. Test your chosen widget in a normal sidebar or widget area first. Make sure it works.
  2. Then and only then activate this plugin
  3. Go to Appearance > widgets and find the " widgets for shortcode" sidebar or widget area
  4. Drag your chosen widget from your normal sidebar to the shortcodes sidebar. Save.
  5. Now go to a page and enter a shortcode (Or Go the shortcode any widget settings. Click on one of the create page links to help you setup the shortcode in a new page.)
  • [do_widget widgetname] eg: [do_widget calendar]
  • [do_widget "widget name"]. eg: [do_widget "tag cloud"]
  • [do_widget id=widgetid] . eg: [do_widget id=tag-cloud-3]

  • [do_widget_area] (will use the "widgets in shortcodes" widget area / sidebar

  • [do_widget_area sidebarname] for another sidebar or widget area - eg: to maximise likelihood of getting your theme's widget css to apply.
  1. If the plugin cannot work out what you want and you are logged in as an administrator, it will show a debug prompt to you (the logged in admin) only. Sometimes the widget name that wordpress calls it internally is not the same as what you see on the screen and you will need the 'debug' to find the id.

* Click on the link 'Try debug'. It will produce a bunch of info. * Look for the id of your widget in the shortcodes sidebar (you may have to scroll through a lot of debug info). * Try using the widget id - ie [do_widget id=somename-n]. Examples are tag-cloud-3, meta-2 etc.

STOP - Do not read any further until you have got the basics working. You may make it too complicated, when it can be so simple.

[do_widget ...] Parameters:

  • nameofwidget or name="nameofwidget" This is NOT the title of the widget. THis is the name that you see in the widgets menu page even when unassigned to a sidebar. For existing users , you can also use just the name of the widget without name=. It must be the first parameter then. You can only do this with the name, not the id.
  • id=wordpress assigned id of widget. Examples: id=meta-3, id=tag-cloud-9 etc
  • title=false to hide the widgets title OR to override your themes first sidebar html settings for widget titles, use title=htmltag where htmltag is one of h1,h2,h3,h4,h5,header,strong,em. If not entered plugin will use the same title html that your themes first sidebar uses - yes even if you change themes, it will switch to the new themes html.
  • wrap=htmltag where htmltag is one of div,p,main,aside,section. This will override your themes first sidebar html settings for widget wrapping html.
  • widget_classes=none This will remove the class "widget" from the wrapping html and the class "widget_title" from the title html. This may be enough to remove any unwanted css styling from your theme.
  • class=yourclassname By default the plugin will add a class of amr-widget tto the wrapping html. You can use this to add any special css. Add css either by editing your themes stylesheet if it is a custom theme, or using something like the wordpress custom css plugin.
  • sidebar="sidebarname" will default to widgets_for_shortcode sidebar. Only use if you want to re-use a widget already beingused in another sidebar. THis is theme dependent and WILL break if you change themes.

[do_widget_area ...] Parameters:

  • widget_area=yourwidgetarea defaults to 'widgets_for_shortcodes' if nothing entered
  • widget_area_class=none /* option to remove theme styling by removing the widget_area class from the sidebar html */
  • widget_classes=none /* option to remove the widget class from the widget wrappinghtml
  • class=yourclassname default is amr_widget_area. This will affect the widget area NOT the individual widgets. At the moment can only remove the widget classes, not replace them when using do_widget_area.

Advanced users WARNING: using do_widget_area with a widget area other than the shortcode one means that if you changes themes and the new theme has different sidebars, then this shortcode with a named widget area will not work. Got that ?

See the settings page for links to help your create the shortcodes in a page.

To 'remove debug mode' remove ?do_widget_debug=1 from the url you are looking at (NOTE it only debugs if you are logged in and an administrator, so this is really NOT a problem.)

The plugin has been tested with most standard widgets (rss feeds, tag cloud, pages, meta, search, and of course my own plugins widgets - upcoming events list, calendar and user lists.

If you use a widget more than once for different reasons, you may need to use the widget id to isolate which widget instance and it's settings to use. ie: [do_widget id=categories-6] . If you just use the name, it will display all widgets in the shortcode sidebar with that name (all instances).

See also home page

If you liked this plugin, you might also like my other plugins:

  • icalevents.com - a ics compliant events plugin fully integrated with wordpress, so it will work with many other plugins (seo, maps, social)
  • wpusersplugin.com - a suite of plugins to help with membership sites. Major plugin is amr users

Compatible up to: 4.0.1
Last Updated: 2015-3-29
Active Installs: 40,000+

Ratings

4.9 out of 5 stars

Support

4 of 11 support threads in the last two months have been resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say 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,2,2
100,2,2
100,2,2
80,5,4 100,2,2
100,2,2