WordPress

Creating Dashboard Widgets in WordPress

Written by AskYouNow
There are tons of new themes coming out for WordPress every day, but none of them seems to utilize this feature. WordPress developers should add custom dashboard widget with support information. In this article we will show you how you can customize dashboard widgets in WordPress.

If you are an admin developer then you must have seen that when we login to the admin dashboard, some data is shown to us on the dashboard screen.

Today I will tell you how we can add our custom widget.

You can add your custom dashboard widget by adding the following code block in the function file of your active theme.

Note: Before adding the code block, take a backup of your function file.

add_action('wp_dashboard_setup', 'my_custom_dashboard_widgets');
 
function my_custom_dashboard_widgets() {
	global $wp_meta_boxes;
	 
	wp_add_dashboard_widget('custom_help_widget', 'Theme Support', 'custom_dashboard_help');
}
function custom_dashboard_help() {
	echo 'Welcome to our Blog For WordPress Tutorials visit: Ask You Now'; 
}
This code can be very helpful when creating custom themes for clients.

We hope this article helped you learn how to add custom dashboard widget in WordPress.

About the author

AskYouNow

1 Comment

Leave a Comment

Retype the CAPTCHA code from the image
Change the CAPTCHA codeSpeak the CAPTCHA code