Import Feed With WordPress

This tutorial is for WordPress users. Sometimes, you want to import and attach an RSS Feed into somewhere in your page instead on sidebars. To do this, there are two possible method. Use simple PHP or JavaScript. In this post, i will talk about using the PHP one because it is simpler.
By default, you should [...]

This tutorial is for WordPress users. Sometimes, you want to import and attach an RSS Feed into somewhere in your page instead on sidebars. To do this, there are two possible method. Use simple PHP or JavaScript. In this post, i will talk about using the PHP one because it is simpler.

By default, you should use PHP commands fopen() or file_get_contents() to fetch the feed content and output the data, but in WordPress, there is already function about it, it called fetch_feed() . Thanks to WordPress again :-)

Short of words, let have your PHP file ready to be editted. You can manually edit it on offline or using Theme Editor in Admin Page. And below is the short PHP code you should basically know:

<?php
$rss_url = Array("http://mr.hokya.com/","site2");
$feed = fetch_feed($rss_url);
wp_widget_rss_output($feed,"show_date=0&show_author=0&show_summary&items=5");
?>

Some benefit using this WordPress Declared Function

  1. It will fetches and shows your desired RSS Feed into somewhere you place that PHP code.
  2. It can fetches multiple RSS Feed from multiple URL and sorts it by the date
  3. This method uses fetch_feed() to automatically finds Feed URL of a site and fetches it into Feed Class.
  4. It uses wp_widget_rss_output to output the RSS Feed items. Naturally, it is used in RSS Widget :-)
  5. You can determine whether show the date or not by changing the value of show_date into 1 for showing, or 0 for not showing.
  6. You can determine whether show the author or not by changing the value of show_author into 1 for showing, or 0 for not showing.
  7. You can determine whether show the summary or not by changing the value of show_summary into 1 for showing, or 0 for not showing. If you choose 0, you will only see the title of the item.
  8. You can specify the max items of RSS feed to show within one site by changing the value items.

Posted on , , ,

Bookmark and Share

2 Responses to “Import Feed With WordPress”

Leave a Reply


AJAX Random Post

  • Mailing List on WordPress

    Do you ever want to retrieve and get the list of email addresses from your WordPress blog. If you ever feel like that and curious about it, then i will teach you how in this post. WordPress stores databases of emails from the commentators when people post a comment into each posts. So with some litt
  • Check Your Blog's Price

    When i surfed few days ago, i found an unique web service or web tools to measure the price of your blog. Well, maybe some of you have known and pretty popular with this service. It is WebValuer. That site is easy to use. You just need to type the URL and get your site observed. If you have pretty
  • 18 Best Paid Blogging

    Today, blogging activity can be an alternative way to get money or as second profession. A big number of bloggers create and manage their blog to earn revenue from the internet services. Those services are like: pay per click program, Google AdSense, online reviews, and paid to blog. Those programs
  • Add Signature on Post

    Maybe it is rather important for someone or some people to put their signature on their own writting. The signature itself symbolize legal and official of the contents. For bloggers, signature can also be introduced electronically. Make a drawing and scan it as JPEG picture is a good idea. You can
  • Use BlogCatalog's Avatar on WordPress Blogs

    Hey there, i recently checked BlogCatalog's Developer Section and found this way. Maybe it is not too hot to talk about but now, with BlogCatalog's API, let me introduce my new plugin: BlogCatalog Avatar. Just like the name, it loads BlogCatalog's avatar image next to every of your comments. In oth

References

Who am I ?

My name is Julian Widya Perdana. I study at University of Gadjah Mada, Yogyakarta. I am a young developer addicted in JavaScript, Plugins, Themes, AJAX, and PHP developement. If you feel satisfy with my work, please support me to keep it developed