/ Published in: PHP
Taken from an article of http://smashingmagazine.com
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
add_action('wp_dashboard_setup', 'my_dashboard_widgets'); function my_dashboard_widgets() { global $wp_meta_boxes; // remove unnecessary widgets // var_dump( $wp_meta_boxes['dashboard'] ); // use to get all the widget IDs $wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins'], $wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary'], $wp_meta_boxes['dashboard']['side']['core']['dashboard_primary'] ); // add a custom dashboard widget wp_add_dashboard_widget( 'dashboard_custom_feed', 'News from yoursite', 'dashboard_custom_feed_output' ); //add new RSS feed output } function dashboard_custom_feed_output() { echo '<div class="rss-widget">'; 'url' => 'http://www.yoursite.com/feed', 'title' => 'What\'s up at yoursite', 'items' => 2, 'show_summary' => 1, 'show_author' => 0, 'show_date' => 1 )); echo "</div>"; }
URL: http://smashingmagazine.com