[wp-hackers] Add same widget to multiple sidebars

Dion Hulse (dd32) wordpress at dd32.id.au
Fri May 25 11:59:21 UTC 2012


If you use the new Widgets API (That means extending the WP_Widget
class) then you should automagically get multi-instance.
See http://codex.wordpress.org/Widgets_API#Developing_Widgets for details

On 25 May 2012 21:56, Dino Termini <dino at duechiacchiere.it> wrote:
> Hi folks,
>
> in my template I have multiple sidebars, one for the homepage, one for the
> archive page, and so on. Each of them has a different set of widgets in it,
> but some widgets should be shared among sidebars. I've written the usual
> code
>
> function my_widget(){
>
> }
> wp_register_sidebar_widget(...)
>
> But as soon as I assign a widget to a sidebar, it disappears from the list
> of available filters, making it unavailable for other sidebars. I see the
> Text Widget, though, can be reused multiple times. I've found a few
> different ways of doing this, but I'd like to ask this list about what's the
> 'final' and best way of making a 'reusable' widget.
>
> Thanks folks,
> Dino.
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers


More information about the wp-hackers mailing list