Forums

Problem importing an RSS feed into my Wordpress blog (12 posts)

  1. wasnotwas
    Member
    Posted 6 months ago #

    I have included the following code.

    <?php
    require_once (ABSPATH . WPINC . '/rss.php');
    wp_rss('http://alpha.libre.fm/rdf.php?fmt=rss&amp;page=/user/bananabob/recent-tracks',5);
    ?>

    And also tried

    <?php
    require_once(ABSPATH . WPINC . '/rss-functions.php');
    get_rss('http://alpha.libre.fm/rdf.php?fmt=rss&amp;page=/user/bananabob/recent-tracks', $num = 5);
    ?>

    as well as

    <?php
    require_once (ABSPATH . WPINC . '/rss-functions.php');
    // here's where to insert the feed address
    $rss = @fetch_rss('http://alpha.libre.fm/rdf.php?fmt=rss&amp;page=/user/bananabob/recent-tracks');
    if ( isset($rss->items) &amp;&amp; 0 != count($rss->items) ) {
    ?>
    <ul>
    <?php
    // here's (5) where to set the number of headlines
    $rss->items = array_slice($rss->items, 0,105);
    foreach ($rss->items as $item ) {
    ?>
    <li>
    <a href='<?php echo wp_filter_kses($item['link']); ?>'>
    <?php echo wp_specialchars($item['title']); ?>
    </a>
    </li>
    <?php } ?>
    </ul>
    <?php } ?>

    None of which display anything in my blog.
    Can someone help me solve this mystery.

  2. stvwlf
    Member
    Posted 6 months ago #

  3. wasnotwas
    Member
    Posted 6 months ago #

    I think I might wait for Wordpress 2.8 It should be easier then!

  4. wasnotwas
    Member
    Posted 6 months ago #

    I have downloaded 2.8 beta 1 and use the following code

    <?php
    require_once (ABSPATH . WPINC . '/rss.php');
    SimplePie($feed_url = 'http://alpha.libre.fm/rdf.php?fmt=rss&amp;page=/user/bananabob/recent-tracks', $cache_location = null, $cache_duration = null) 
    
    ?>

    And get the following error:
    Fatal error: Call to undefined function SimplePie() in

    Help!

  5. kmessinger
    Member
    Posted 6 months ago #

    You are complicating things - use the rss widget.

  6. wasnotwas
    Member
    Posted 6 months ago #

    How can you use a widget in the page contents rather than the sidebar?

  7. kmessinger
    Member
    Posted 6 months ago #

    Where do you want to put this feed? Do you want it to come in as a post? Is it supposed to come in as content?

  8. wasnotwas
    Member
    Posted 6 months ago #

    NO - I want it not in the sidebar. I have divided the page up I use my own theme.

  9. kmessinger
    Member
    Posted 6 months ago #

    I know you don't want it in the sidebar. What I was asking is do you want it to look like feed or are you trying to use someone's feed as content.

  10. wasnotwas
    Member
    Posted 6 months ago #

    I want it to look like a post

  11. babypress
    Member
    Posted 5 months ago #

    how did you go, did yo get it working, Im looking at doing the same thing

  12. kmessinger
    Member
    Posted 5 months ago #

    Q.

    are you trying to use someone's feed as content

    A.

    I want it to look like a post

    Im looking at doing the same thing

    It is not good to use someone else's feed as a post in your site. There would definitely be copyright issues.

Reply

You must log in to post.

About this Topic