WordPress.org

Ready to get started?Download WordPress

Forums

Display an external feed as a page: parsing an RSS Feed (3 posts)

  1. r11
    Member
    Posted 5 years ago #

    Good morning from Canada,

    I have set up a syndicated feed list through "Rojo.com" (excellent service) and I would like to parse it to a page. I already have it working for the title and the link, however the "content/description" is formatted in an array that doesn't seem to parse.

    Here is the code:

    <!-- RSS feed -->
    
    <?php
    if (is_page('RSS Syndication') ){
     require_once(ABSPATH . WPINC . '/rss.php');
     $rss = fetch_rss('http://www.server.com/externalfeed.rss');
     for( $i=0; $i<25; $i++ ) {
      $item=$rss->items[$i];
      $pubdate=substr($item['pubdate'], 0, 16);
      echo '
       <a href="'.$item['link'].'" title="'.$item['title'].'"><b>'.$item['title'].'</b></a>
       <i>'.$pubdate.'</i>
       <i>'.$item['content'].' content</i>
       <i>'.$item['summary'].' summary</i>
       <i>'.$item['title'].' title</i>
       <i>'.$item['content'].' content</i>
       <a href="'.$item['link'].'">more...</a>
       ';
      }
     }
    ?>
    <!-- End of feed -->

    First of all, the content outputs "Array", and the summary is blank. Second, is there a built in parser in rss.php that I can use? I noticed the "get_rss" function in the bottom of the rss.php file.

    Thank you for your support, I am extremely new to this.

  2. r11
    Member
    Posted 5 years ago #

    <!-- RSS feed from Rojo -->
    
    <?php
     if (is_page('RSS Syndication') ){
      require_once(ABSPATH . WPINC . '/rss.php');
      wp_rss('feedurl.com/feed.rss', 10);
     }
    ?>
    
    <!-- End of feed -->

    Woop wOOp! This seems to work for me. I hope this helps someone else. now to embed a player to play podcast feeds back to back like a streaming audio channel with other peoples bandwidth! hehe. Let me know if you figure this one out.

  3. r11
    Member
    Posted 5 years ago #

    argh.. I still cant seem to get other variables (description, author, etc...) to show. Any suggestions?

Topic Closed

This topic has been closed to new replies.

About this Topic