I showed you how to use widgets using the_widget in your php templates before. Upon request, I am going to show you how to use WordPress RSS Widget with the help of WordPress the_widget function.

It’s quite simple actually, all you need is the URL of the RSS Feed and number of items to be displayed. Here is the snippet to display feed items using php:

   if(function_exists('the_widget')) { // If the_widget is supported
		$rss_options = array( 
			'title' => 'Test',  // Title of the Widget
			'url' => 'https://wpassist.me/feed/', // URL of the RSS Feed
			'items' => 10, // Number of items to be displayed
			'show_summary' => 0, // Show post excerpts?
			'show_author' => 0, // Set 1 to display post author
			'show_date' => 0 // Set 1 to display post dates
		the_widget('WP_Widget_RSS', $rss_options);

You can either put this code in a sidebar template, or maybe to a page template if you like. Just copy and paste the code, and then edit URL and item count options. Then you will have a widget displaying feed items as a list.

Deal Notice: We are using A2 hosting for all of our websites, and we are really happy with their service. So we wanted to share you this discount link for you to try it out. If you get a hosting using this link, you will also help us build better content for you: SSD Hosting - 300% Faster Than Standard Hard Drives