Brace yourselves; Super Bowl is coming – show NFL news on WordPress site

Super Bowl LI (that’s the 51st for you non-Romans) is closing up on us. It is scheduled for Sunday, February 5, 2017, so that’s only two weeks away! If you live in Houston, Texas or have a chance to go their NRG Stadium, you’re about to witness something every male American dream of – watching the Super Bowl live.

We’re still two games away from knowing which teams will be in this year’s “clash of titans”. On this Sunday, Green Bay Packers will face Atlanta Falcons. On the same day, somewhat later, Pittsburgh Steelers and New England Patriots will test their actions on the Gillette Stadium.

We are not going into details about the game. Instead, let’s focus on WordPress. If you are a fan, or you run a sports site powered by WordPress, how can you show the latest NFL news on your site? Quick answer: RSS feed. Now let’s go a bit more into details and show you how to put the NFL news on your site.

Use WordPress widget to show NFL news

Since WordPress comes equipped with an awesome RSS feed widget, this is the easiest and the quickest way of showing NFL news on your site. The only thing you need for this option is to get the RSS feed link. There are just a few steps before you can display the latest news or videos:

  1. Navigate to http://www.nfl.com/rss
  2. Choose the feed you’re interested in and copy the URL
  3. Go to Appearance -> Widgets -> RSS
  4. Drag the widget to an active widget area
  5. Paste the RSS feed URL
  6. for example:
    – http://www.nfl.com/rss/rsslanding?searchString=home
    – http://www.nfl.com/rss/rsslanding?searchString=gamehighlightsVideo

  7. Add a title, choose the number of feeds to display and select a few more options
  8. Save changes

NFL news widget

That’s all it takes to show the RSS feed. If you preview your site, you will see the latest NFL news on your sidebar, footer or wherever you added the widget. Since this is a simple widget, there are no additional options. So, if you want to style the news differently, you will have to edit the CSS code manually. Or, if you want more, you should know there are more than just a few RSS feed plugins ready to help you.

Use 5sec Content Scroller Widget

If you want your NFL news to stand out, you will be interested in 5sec Content Scroller Widget

This premium plugin has more than 340 sales and 4.17/5 stars based on 54 ratings on CodeCanyon. The plugin is highly customizable, and it allows you to scroll practically any type of content. It can scroll the content from your site, so if you are writing about football, you can show off your own articles in the widget. You get to scroll more than one Twitter timelines so, besides your own, you can easily embed the NFL Twitter on your site. Since we’re talking about RSS feeds in this article, you should know that 5sec Content Scroller can show the latest feed from any source, including NFL news, and do much more for you.

5sec Content Scroller

To get the picture of what would your news look like, take a look at the demo page

Use other RSS feed plugins

Similarly to the previous technique, 3rd party plugins can help you with embedding the RSS feed to your WordPress site. Since most of them work similarly, we’re not going to show you each and every one of them, but will just give you the names of those plugins so that you can explore them in details:

Add RSS code manually

If you’re comfortable around code and changing a line or two by yourself, you don’t have to install additional plugins. You can have NFL news anywhere you want. We already showed you the code necessary for displaying external RSS feeds. This time, we will prepare the code to show top headlines from nfl.com. All you need to do is to c/p the code to any of the templates.

get_item_quantity(4);
$rss_items = $rss->get_items(0, $maxitems);
?>

You should copy the code to any template you want, or you can run the PHP code from the Text widget. That was easy, wasn’t it? If you have any trouble with the code, feel free to leave a comment, and we’ll help you.

If you are OK with modifying the code, you can do a few quick changes to the RSS feed, i.e. your NFL news.

Change the second line and add RSS feed which will show video highlights, news from your favorite team or anything else available from the official NFL website RSS feed

On the third line, change the number in the brackets to any number of feeds you want to display. Yes, it was easy as that.

Add NFL news only to your dashboard

If you are busy working on your WordPress site and you’re often to be found on the dashboard, you can display the latest NFL news just to the backend users. Instead of showing the feed to your readers, show it only to admins and authors. You can do that just for easier reading, so you don’t have to navigate away from your site, or you can help yourself when writing new sports-related articles.

No matter the reason, you will just need a simple code to add the feed to your dashboard. Since we already showed you how to do that, we’re about to give you the code. Just copy and paste this code to your functions.php file:

function wpc_dashboard_widgets() {
global $wp_meta_boxes;
// remove unnecessary widgets
// var_dump( $wp_meta_boxes['dashboard'] ); // use to get all the widget IDs
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']
);
// add a custom dashboard widget
wp_add_dashboard_widget( 'dashboard_custom_feed', 'WP Loop', 'dashboard_custom_feed_output' ); //add new RSS feed output
}

function dashboard_custom_feed_output() {
echo '
'; wp_widget_rss_output(array( 'url' => 'http://www.nfl.com/rss/rsslanding?searchString=gamehighlightsVideo', 'items' => 5, 'show_summary' => 1, 'show_author' => 0, 'show_date' => 1 )); echo "
"; } add_action('wp_dashboard_setup', 'wpc_dashboard_widgets');

To show you how to change the feed, we put the NFL feed for the video highlights in the code. Just like with the previous example, you can choose any feed from the NFL site, or actually any other site you want.


No matter which method you decided to use, you should be able to implement NFL news to your WordPress site without problems. If you’re having difficulties with any of the techniques or need additional info, please don’t hesitate to leave a comment and we will help you.

Are you going to watch Super Bowl LI? Who are your favorites?

START YOUR OWN BLOG

This guide is an introduction to mastering the art of blogging. It provides easy to follow steps to start, maintain, and grow your blog.

Read the guide

Leave a Reply

Your email address will not be published. Required fields are marked *