Add custom widget in the dashboard

Home » how-to » wordpress » Add custom widget in the dashboard
wordpress Nessun commento

For add a custom widget in dashboard u need edit functions.php of ur theme in use, and add follow code:

[code]

/**
*
* Add a custom widget in the dashboard
*
*/

add_action(‘wp_dashboard_setup’, ‘my_custom_dashboard_widgets’);

function my_custom_dashboard_widgets() {
wp_add_dashboard_widget(‘custom_help_widget’, ‘TITLE VISIBLE’, ‘custom_dashboard_help’);
}

function custom_dashboard_help() {
$content = ‘INSERT HERE UR CODE (HTML ALLOWED)’;
echo $content;
}

[/code]

TITLE VISIBLE : its a title that u view on the top bar of widget
INSERT HERE UR CODE (HTML ALLOWED) : its a content of widget, html code avaible