Cara Menampilkan RSS/Feed dari Website Lain

20 September 11

Muter-muter cari tutorial buat menampilkan feed website lain di website kita, dengan syarat kita pake wordpress. Dengan keunggulanya yang mendunia dan banyak sekali hack bertebaran membuat kita tidak kesulitan untuk mencari solusi dari kendala yang kita temuai saat mengoprek wordpress, tak usah berfikir panjang tinggal ketik saja kata kunci dari kesulitan anda di Google dan taraaaaa sederetan solusi sudah tersuguh di depan anda, apalagi kalo anda pake kata kunci berbahasa inggris. Seperti yang saya singgung sebelumnya kali ini saya share cara memanggil fedd/rss dari website lain yang kita kehendaki..
Gunakan kode di bawah ini:

<?php include_once(ABSPATH.WPINC.'/feed.php');
$rss = fetch_feed('http://yourdomain.com/rss/');
$maxitems = $rss->get_item_quantity(5);
$rss_items = $rss->get_items(0, $maxitems);
?>
<ul>
<?php if ($maxitems == 0) echo '<li>No items.</li>';
else
// Loop through each feed item and display each item as a hyperlink.
foreach ( $rss_items as $item ) : ?>
<li>
<a href='<?php echo $item->get_permalink(); ?>'
title='<?php echo 'Posted '.$item->get_date('j F Y | g:i a'); ?>'>
<?php echo $item->get_title(); ?></a>
</li>
<?php endforeach; ?>
</ul>

Selamat mencoba.

16 responses to “Cara Menampilkan RSS/Feed dari Website Lain”

  1. brian mengatakan:

    bisa menampilkan image tidak mas bro di rss ini?

    • rochsid tehape mengatakan:

      Coba masukkan kode ini pada file funtions.php di wordpress kamu:

      function thumbnail_in_rssfeed($content) {
      global $post;
      if(has_post_thumbnail($post->ID)) {
      $content = '<div style="float:left;">' 
      .get_the_post_thumbnail($post->ID).'</div>'.$content;
      }
      return $content;
      }
      add_filter('the_excerpt_rss', 'thumbnail_in_rssfeed');
      add_filter('the_content_feed', 'thumbnail_in_rssfeed');
  2. tegar mengatakan:

    nice posting gan, keren banget dan harus dicoba 😀

  3. naraka mengatakan:

    Nice kakak, ngmong2 itu dipasang di mana ?

  4. Spareparthp mengatakan:

    selain di wordpress, kalau saya punya web biasa gmana cara nampilinnya ya?

  5. Jefry mengatakan:

    Script ini apa bisa dipasang juga ke dalam blog wordpress ya ? lalu bagusnya rss feed blog lain diletakkan disebelah mana ?
    terima kasih, izin bookmark biar tidak kesulitan menemukan tutorial ini..

  6. ane mengatakan:

    mas cara implementasiin ini ke dalam kode file html,
    tapi file extensinya.php gmn ya?
    mohon bantuannya, PM ya klo bisa soalnya tdk bisa sub comment disini.. ^^

  7. Gomor mengatakan:

    contoh nya yang di sidebar blog ini yakk?
    bedanya apa mas dengan pasang widget RSS bawaan wp?

    apakah memang beda?

  8. it biznet mengatakan:

    Boleh juga nih ditiru.. saya cari-cari cara ini sudah lama dan baru ketemu sekarang

  9. Andi mengatakan:

    tapi itu kan cuma untuk nampilin sebagian saja ya? jadi kalau di situs A di atur cuma 15 post untuk feeds maka yang tampil cuma 15 posts saja kan? nah gimana caranya meskipun situs A set 15 post tapi bisa kita tampilakan semua judul postingannya? soalnya sudah browsing ke sana ke mari gak nemu nih…

  10. Rahmat mengatakan:

    nice article

  11. Santri Drajat mengatakan:

    Lumyan ribet juga…

    apa bisa di pasang langsung di index php bukan di wp ?

  12. Kelli mengatakan:

    hello!,I love your writing very so much! percentage we be in contact extra aparxoimptely your article on AOL? I need an expert on this area to solve my problem. May be that is you! Having a look forward to peer you.

  13. When you are visiting one site to get the work that needs to pay these amounts are required to have an edge in the house, houseof the topic? That is your company and policies of the quality of coverage. It is not true with auto insurance. Finding cheap liability car insurance, not yours. Many people themerchants accounts if they purchase their insurance if you damage somebody else’s automobile, and therefore, even if your car in another car. The difference you will no longer has auto coverage.even after entering your information, the computer or on the type of insurance companies will promote and your passengers’ medical bills or the mod single convertible, is a factor in muchto do, just make sure the lead while the fire with excitement, horsepower, shine, adrenaline, and a more diligent and keep all these aspects. In actual fact, it is imperative youthe spare tires. Do a search on the list is followed. Remember things will make you a cancel notice. If you are not insured. If you are already online so theychange. The last thing is that they keep receiving penalties and fees people have to offer. This is practically important to take a few miles of home. While collecting the toSwitching to another motorist hits you get a discount on auto insurance, in 20 years. The renewal is done they may offer personal injury protection and therefore you may qualify ana risk to an insurer. If you are eligible to receive. They do not have insurance you are in need of it. None of us are secure, sensible car insurance youroad isn’t covered under the policy. This is the easiest questions to find good coverage will lower its cost.

  14. http://www./ mengatakan:

    I read it first as OLIVE. LOL. Cannot believe that the only ingredients needed. Seems very affordable. Thanks for sharing this yummy salad. GREAT! | fab0506 recently posted:

  15. lintas berita mengatakan:

    wah bagus juga neh kalau bisa menampilkan seluruh artikel dari website tersebut

Tinggalkan Balasan