diff --git a/includes/admin/class-sp-admin-dashboard.php b/includes/admin/class-sp-admin-dashboard.php
index 49bcac2a..6dc7b4ab 100644
--- a/includes/admin/class-sp-admin-dashboard.php
+++ b/includes/admin/class-sp-admin-dashboard.php
@@ -31,6 +31,7 @@ class SP_Admin_Dashboard {
* Init dashboard widgets
*/
public function init() {
+ wp_add_dashboard_widget( 'sportspress_dashboard_news', __( 'Sports News', 'sportspress' ), array( $this, 'news_widget' ), null, null, 'side' );
wp_add_dashboard_widget( 'sportspress_dashboard_status', __( 'SportsPress', 'sportspress' ), array( $this, 'status_widget' ) );
add_filter( 'dashboard_glance_items', array( $this, 'glance_items' ), 10, 1 );
}
@@ -63,37 +64,61 @@ class SP_Admin_Dashboard {
* Show status widget
*/
public function status_widget() {
- ?>
-
- future ) ? $count->future : 0;
- $published_count = isset( $count->publish ) ? $count->publish : 0;
- $next_event = sp_get_next_event();
- if ( $next_event ):
- $now = new DateTime( current_time( 'mysql', 0 ) );
- $date = new DateTime( $next_event->post_date );
- $interval = date_diff( $now, $date );
- ?>
- -
-
- %s until next event', 'sportspress' ), $interval->days . ' ' . __( 'days', 'sportspress' ) . ' ' . sprintf( '%02s:%02s:%02s', $interval->h, $interval->i, $interval->s ) ); ?>
- (post_title; ?>)
-
-
-
- -
-
- %s event scheduled', '%s events scheduled', $scheduled_count, 'sportspress' ), $scheduled_count ); ?>
-
-
- -
-
- %s event published', '%s events published', $published_count, 'sportspress' ), $published_count ); ?>
-
-
+ ?>
+
+ future ) ? $count->future : 0;
+ $published_count = isset( $count->publish ) ? $count->publish : 0;
+ $next_event = sp_get_next_event();
+ if ( $next_event ):
+ $now = new DateTime( current_time( 'mysql', 0 ) );
+ $date = new DateTime( $next_event->post_date );
+ $interval = date_diff( $now, $date );
+ ?>
+ -
+
+ %s until next event', 'sportspress' ), $interval->days . ' ' . __( 'days', 'sportspress' ) . ' ' . sprintf( '%02s:%02s:%02s', $interval->h, $interval->i, $interval->s ) ); ?>
+ (post_title; ?>)
+
+
+
+ -
+
+ %s event scheduled', '%s events scheduled', $scheduled_count, 'sportspress' ), $scheduled_count ); ?>
+
+
+ -
+
+ %s event published', '%s events published', $published_count, 'sportspress' ), $published_count ); ?>
+
+
+
+ get_item_quantity(5);
+ // Build an array of all the items, starting with element 0 (first element).
+ $rss_items = $rss->get_items(0, $maxitems);
+ }
+ if (!empty($maxitems)) {
+ ?>
+