Using Custom Field as Variable in MagpieRSS
-
OK so I would like to pull in RSS feeds to post templates on my site.
Ideally, I’d like to specify the feed itself as a custom field – I’ve got the code I want for magpie, but where I’m stuck is outputting the custom field as the variable for the Magpie code.
Could anyone offer any advice?
This is the code I’m working with:
<div class="twitter-feed"> <?php require_once('magpierss/rss_fetch.inc'); $num_items = 5; $rss = fetch_rss( 'FEED URL HERE' ); if($rss) { $items = array_slice($rss->items, 0, $num_items); echo "<ul>"; foreach ($items as $item) { $href = $item['link']; $title = $item['title']; $title = str_replace("joshhostels: ", "", "$title"); // see below echo "<li><a href=\"$href\" rel=\"nofollow\">$title</a></li>"; } echo "</ul>"; } else { echo "<p>Feed currently updating. Please check back soon.</p>"; } ?> </div>
So where it says ‘FEED URL HERE’, I need to output the custom field – Could anyone help?
Thanks in advance!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Using Custom Field as Variable in MagpieRSS’ is closed to new replies.