'http://www.wpgeo.com/', 'feed_link' => 'http://www.wpgeo.com/feed/') ); } /** * Add Widget */ function add_widget($widgets) { global $wp_registered_widgets; if (!isset($wp_registered_widgets['wpgeo_dashboard'])) return $widgets; array_splice($widgets, sizeof($widgets) - 1, 0, 'wpgeo_dashboard'); return $widgets; } /** * Widget */ function widget($args = array()) { if (is_array($args)) extract( $args, EXTR_SKIP ); echo $before_widget . $before_title . $widget_name . $after_title; echo '
'; // Include WordPress native RSS functions. include_once(ABSPATH . WPINC . '/rss.php'); $rss = fetch_rss('http://feeds2.feedburner.com/wpgeo'); $items = array_slice($rss->items, 0, 2); if (empty($items)) { echo '

No items

'; } else { foreach ($items as $item) { echo '

' . $item['title'] . '

'; echo '

' . date('l, jS F Y', strtotime($item['pubdate'])) .'

'; echo '

' . $item['summary'] .'

'; } } echo '

View all WP Geo news...

'; echo '
'; echo $after_widget; } } // Start the plugin global $wpgeoDashboard; $wpgeoDashboard = new WPGeoDashboard(); } ?>