Display Images in rss Feeds
-
Using WordPress rss code.
Problem is how to show images from feeds when available.
Code below works but could find nothing that succinctly shows how to display images from feeds, not featured images from posts on own site.
Need code that works for this.<?php if(function_exists('fetch_feed')) { include_once(ABSPATH . WPINC . '/feed.php'); // the file to rss feed generator $feed = fetch_feed('https://anyfeed.com'); // specify the rss feed $limit = $feed->get_item_quantity(6); // specify number of items $items = $feed->get_items(0, $limit); // create an array of items } if ($limit == 0) echo '<div>The feed is either empty or unavailable.</div>'; else foreach ($items as $item) : ?> <FONT FACE='Georgia,serif' SIZE="2" COLOR="#000000"><b> <a href="<?php echo $item->get_permalink(); ?>" alt="<?php echo $item->get_title(); ?>"><?php echo $item->get_title(); ?></a></b></FONT> <FONT COLOR="#000000"><i><?php echo $item->get_date('j F Y @ g:i a'); ?></i> <p><?php echo substr($item->get_description(), 0, 200); ?> ...</p></FONT> <?php endforeach; ?>
Viewing 13 replies - 1 through 13 (of 13 total)
Viewing 13 replies - 1 through 13 (of 13 total)
- The topic ‘Display Images in rss Feeds’ is closed to new replies.