0

I am trying to create a dashboard in post section of wordpress admin area. I want it just underneath the Publish dashboard.

like for example this code here place a dashboard in immediately when I log into the admin area.

// Create the function to output the contents of our Dashboard Widget

function example_dashboard_widget_function() {
    // Display whatever it is you want to show
    echo "Hello World, I'm a great Dashboard Widget";
} 

// Create the function use in the action hook

function example_add_dashboard_widgets() {
    wp_add_dashboard_widget('example_dashboard_widget', 'Example Dashboard Widget', 'example_dashboard_widget_function');   
} 

// Hook into the 'wp_dashboard_setup' action to register our other functions

add_action('wp_dashboard_setup', 'example_add_dashboard_widgets' );
1
  • Looks like you are confusing some terms. First you need to know what is Dashboard, a Dashboard Widget and a Meta Box. As mrwweb says, take a look at the Codex. And I suspect that you may be referring to Custom Meta Boxes, no?
    – brasofilo
    Commented May 17, 2012 at 15:57

1 Answer 1

1

You'll want to look into the add_menu_page() function and then use the $position parameter to place it in the menu where you want it.

2
  • Hey mrwweb, thanks for your answer... can you reference my code above so that I can understand. thank.
    – Ronny K
    Commented May 17, 2012 at 14:16
  • 1
    That code is for adding a dashboard widget to the existing Dashboard ( Codex Reference ). You'll need to start with the $function parameter for add_menu_page() which gives you the callback for outputting your new page's content. It's all there in the Codex, you just have to start reading.
    – mrwweb
    Commented May 17, 2012 at 14:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.