wordpress snippets last updated   : October 6, 2014
we now have 641 snippets

Replace dashboard news feed with another rss feed

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will let you replace the existing RSS feed widget with another RSS feed. Change YOUR_FEED_NAME with the name you wish to display in the widget title this is located on line 09. You will need to also make adjustments to “url, title, items, show_summery, show_author, show_date” located from line 14-19.

snippet :  PHPcopy
add_action('wp_dashboard_setup', 'my_dashboard_widgets');
function my_dashboard_widgets() {
     global $wp_meta_boxes;
     unset(
          $wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins'],
          $wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary'],
          $wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']
     );
     wp_add_dashboard_widget( 'dashboard_custom_feed', 'YOUR_FEED_NAME' , 'dashboard_custom_feed_output' ); 
}

function dashboard_custom_feed_output() {
     echo '<div class="rss-widget">';
     wp_widget_rss_output(array(
          'url' => 'http://wpsnipp.com/feed/',
          'title' => 'MY_FEED_TITLE',
          'items' => 2,
          'show_summary' => 1,
          'show_author' => 0,
          'show_date' => 1
     ));
     echo '</div>';
}
source →

Did you like this post? If so please share it with your friends. Thanks!

  • Stefan

    Gracias

    • http://wpsnipp.com Kevin Chard

       no problem

  • Mark

    This is great.