Nov
12

Widget as shortcode – tips

Shortcode any widget  

Want to keep the widget title to identify it from other instances of the same widget, but want to hide the title when the widget is used in a shortcode (ie in a page)?

[do_widget widgetname title=false]

Want to reference a pre-existing widget configuration in a sidebar?

[do_widget id=widget_id sidebar=sidebar_name]

Share:
  • Digg
  • del.icio.us
  • Facebook
  • RSS
  • Technorati
  • Twitter

Related posts:

  1. The “shortcode any widget” handles multiple instances The shortcode any widget plugin can reference multiple instances of the same widget individually  by targeting the instances unique id. ...
  2. Use a widget in a page or post with a shortcode Available  at wordpress now – This plugin allows you to use any widget as a shortcode in a page or...
  3. V2.3, widget, public user lists Version 2.3 has just been uploaded. It offers the following: Widget - the beginnings of a widget to display any...
  4. Subscribe2 widget markup and css Please refer to updated instructions. The wordpress subscribe 2 plugin is great. Version 4.9 just released – a wonderful alternative...
  5. Subscribe2 Widget Form – an alternate The wordpress subscribe 2 plugin is great – however the form in the widget bothers me. I have raised this ...

3 Comments

1

Hi Anmari, you have a very nice plugin! I tested with:

[do_widget "Search"]
that work ok!

[do_widget id="widgets-reloaded-calendar-5" ]
that work ok

[do_widget id="widgets-reloaded-calendar-6" ]
that work but not respect the seted options and take it from first.
have you any idea of why?

[do_widget id="useronline-3" sidebar=1]
that not work
in this case, what would the the sidebar name to use?
“Default sidebar”, 1, “1″, “sidebar-1″

Best Regard
Sergio

2

Hi Sergio,

Don’t know why calendar-6 does not work – if it is the shortcode sidebar and that widget displays fine in a normal sidebar, it should work (multi widgets work for me, even at same time)

Sidebar name must be exactly as in the sidebar box on the widgets page. If you are using the default theme, it will be “Sidebar 1″ (ie with a space).

New version going up soon.

3

Great Anmarie, and you have right:

the calendar widget work in the same way in any sidebar (so seem to be a little bug of the calendar widget-reload).

and for the sidebar name, it’s ok to! it’s need to use the text title name of the sidebar: i use sidebar=”Barra lateral 2″ when i inspec:

Barra lateral 2 …..

Thank again,

Pescadito!

Leave a Comment

You must be logged in to post a comment.

Membership plugins

Preferred Web Host

Web hosting by ICDSoft Icdsoft - Why? They are good and reasonable, used them since 2001. Read more