Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include_once('http://www.rantsports.com/php/simplepie.inc'); // include the required file
- $feed = new SimplePie();
- $feed->set_feed_url('http://www.tmz.com/category/TMZsports/rss.xml');
- $feed->set_cache_duration(1800);
- $feed->init();
- $limit = $feed->get_item_quantity(3); // specify number of items
- $items = $feed->get_items(0, $limit); // create an array of items
- ?>
- <div class="partners-area">
- <a href="http://www.tmz.com" target="_blank"><img src="http://www.rantsports.com/wp-content/themes/rantsports/images/TMZ_Partner_Logo.jpg" width="135" /></a>
- <?php
- if ($limit == 0) echo '<div>The feed is either empty or unavailable.</div>';
- else foreach ($items as $item) : ?>
- <li><a href="<?php echo $item->get_permalink(); ?>"
- title="<?php echo $item->get_date('j F Y @ g:i a'); ?>" target="_blank">
- <?php echo $item->get_title(); ?>
- </a></li>
- <?php endforeach; ?>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement