Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Forum: Plugins
    In reply to: Multiple Widget Instances

    I wrote up a post on how to create extra copies of widgets for multiple sidebars. The trick is to edit the line of code that registers the widget. For example, I wanted to make duplicates of the Creative Commons License widget, so in the file /wp-content/plugins/wpLicense/widget.php I found the line which registers the widget with the system.

    register_sidebar_widget(array(‘Content License’, ‘widgets’), ‘widget_cc’);`

    and changed it to be four lines

    register_sidebar_widget(array(‘Content License 1’, ‘widgets’), ‘widget_cc’);
    register_sidebar_widget(array(‘Content License 2’, ‘widgets’), ‘widget_cc’);
    register_sidebar_widget(array(‘Content License 3’, ‘widgets’), ‘widget_cc’);
    register_sidebar_widget(array(‘Content License 4’, ‘widgets’), ‘widget_cc’);`

    Now when I go to the admin interface, four different widgets show up that I can drag to four different sidebars.

    Shameless plug: more info about multiple widgets on the blog post.

    I found this thread useful when implementing multiple sidebars. I wrote up some additional information, including how to have certain standard widgets in every sidebar and posted the info on my blog. Please forgive the shameless self promotion. 🙂

Viewing 2 replies - 1 through 2 (of 2 total)