I am building my first site in wordpress. I want to get the data from here, the Events in the Holme Valley South Ward – RSS.
First of all, I am unsure whether to use the XML or the RSS link, I thought RSS was XML. I have managed to get the RSS one to work though and not the XML one.
Secondly, the RSS feed is only displaying links to the items, I want to get all the data that is displayed when one clicks the RSS link or pastes it into a browser.
Lastly, is there any way to give them unique ids or classes even in the html without manually doing it using jquery?
If it helps, here is a link to my wordpress page where the feed is only generating links. The code I am using to generate the RSS feed is:
<?php
include_once(ABSPATH.WPINC.'/rss.php'); // path to include script
$feed = fetch_rss('http://www.kirklees.gov.uk/Rss/KMCrss.asmx/events_by_ward?ward_name=Holme+Valley+South'); // specify feed url
$items = array_slice($feed->items, 0, 7); // specify first and last item
?>
<?php if (!empty($items)) : ?>
<?php foreach ($items as $item) : ?>
<h2><a href="<?php echo $item['link']; ?>"><?php echo $item['title']; ?></a></h2>
<p><?php echo $item['description']; ?></p>
<?php endforeach; ?>
<?php endif; ?>
Sorted it out. I used some different php code to display it and it displays it all fine now. For anyone who wants to display items from RSS feed on wordpress, you can use this: