<?php
$rss = new DOMDocument();
$rss->load('https://www.wp-experts.in/blog/feed/'); //RSS FEED URL
$feed = array();
foreach ($rss->getElementsByTagName('item') as $node) {
$item = array (
'title' => $node->getElementsByTagName('title')->item(0)->nodeValue,
'desc' => $node->getElementsByTagName('description')->item(0)->nodeValue,
'link' => $node->getElementsByTagName('link')->item(0)->nodeValue,
'date' => $node->getElementsByTagName('pubDate')->item(0)->nodeValue,
);
array_push($feed, $item);
}
$limit = 5;
for($x=0;$x<$limit;$x++) {
$title = str_replace(' & ', ' & ', $feed[$x]['title']);
$link = $feed[$x]['link'];
$description = $feed[$x]['desc'];
$date = date('l F d, Y', strtotime($feed[$x]['date']));
echo '<p><strong><a href="'.$link.'" title="'.$title.'">'.$title.'</a></strong><br />';
echo '<small><em>Posted on '.$date.'</em></small></p>';
echo '<p>'.$description.'</p>';
}
?>
Enjoy Code! (code provided by Raghunath ) How can I display RSS feed on mysite?
Hello Everyone!
Hope you all are doing well.
If you want to display the content from any blog on your site through the RSS FEED then please use my code.
I hope this will be very help full for you :)
Simply wish to say your article iss as amazing.
The clearness in your post iss simply nice and i can suppose
you are an expert on this subject. Fine with your permission let me to clutch your feed to keep updated with drawing close
post. Thank yoou a million and please keep up the gratifying work.
It¡¦s actually a nice and helpful piece of info. I am satisfied that you shared this useful information with us. Please stay us informed like this. Thanks for sharing.
Wonderful article! That is the kind of information that are
supposed to be shared around the web. Shame
on Google for not positioning this post upper!
Come on over and consult with my site . Thanks =)