• Resolved hoofedcracker

    (@hoofedcracker)


    Hi,
    How can one add Multiple widgets to the admin dashboard?
    I have this:

    function dashboard_widget_first_function() {echo 'CONTENTS';}
    function add_dashboard_widgets() {wp_add_dashboard_widget('dashboard_widget_first', 'Widget Name', 'dashboard_widget_first_function');}
    add_action('wp_dashboard_setup', 'add_dashboard_widgets' );


    [Please use the backticks or code buttons when posting code – thanks.]

    Which adds one (1) widget, I have tried duplicating etc (with different function names) but it seems to corrupt the script. Cheers!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    You can only add the widget once in script, and that’s all you need. Once it appears with the available widgets, you can drag it multiple times into any area. This action creates new instances of the same widget each time. Each instance is it’s own object and can be customized independently of the others.

    Thread Starter hoofedcracker

    (@hoofedcracker)

    Thank you for the response.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Adding Multiple Widgets to dashboard’ is closed to new replies.