X

Add a Dashboard Widget

The first thing a user sees when logging in is the WordPress Dashboard. It’s filled with widgets, which the user can interact with. To add your own, just add this code to functions.php

Code Snippet:

<?php function your_dashboard_widget() { ?>
<h3>Hello Wordpress user!</h3>
<p>Fill this with HTML or PHP.</p>
<?php };
function add_your_dashboard_widget() {
  wp_add_dashboard_widget( 'your_dashboard_widget', __( 'Widget Title!' ), 'your_dashboard_widget' );
}
add_action('wp_dashboard_setup', 'add_your_dashboard_widget' );
?>

Comments  Leave a Reply

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!