Tuesday, July 17, 2012

Adding your own News Feed to the Wordpress Admin Dashboard


<?php
  function wp_admin_dashboard_add_news_feed_widget() {
  global $wp_meta_boxes;

// Our new dashboard widget

  wp_add_dashboard_widget( 'dashboard_gravfx_feed', 'News from h20bikash.blogspot.com', 'dashboard_gravfx_feed_output' );

  }

  add_action('wp_dashboard_setup', 'wp_admin_dashboard_add_news_feed_widget');

function dashboard_gravfx_feed_output() {
  echo '<div>';
  wp_widget_rss_output(array(
  'url' => 'http://h20bikash.blogspot.com/atom.xml',
  'title' => 'Latest news from drikict.net',
  'items' => 2,
  'show_summary' => 1,
  'show_author' => 0,
  'show_date' => 1

  ));
  echo "</div>";

  }
  ?>

No comments:

Post a Comment