implement/show styled RSS Feed in PHP (wordpress)

I have an amazon link

http://www.amazon.de/rss/new-releases/videogames/

I’d like to have it shown on a place of my choice. I have an external php file in which the rss feed should show up as kind of list. Has somebody an idea of getting this working without plugin?

Read More

Thanks a lot folks!

AD

Related posts

Leave a Reply

1 comment

  1. The following code have to be pasted wherever you want to display the feed.

    Don’t forget to update the feed url on line 3. Number of items to be displayed can be defined on line 6.

    <?php
    include_once(ABSPATH . WPINC . '/rss.php');
    $feed = 'http://www.amazon.de/rss/new-releases/videogames/';
    $rss = fetch_feed($feed);
    if (!is_wp_error( $rss ) ) :
        $maxitems = $rss->get_item_quantity(3);
        $rss_items = $rss->get_items(0, $maxitems);
        if ($rss_items):
            echo "<ul>n";
            foreach ( $rss_items as $item ) :
                echo '<li>';
                echo '<a href="' . $item->get_permalink() . '">' . $item->get_title() . "</a>n";
                echo '<p>' . $item->get_description() . "</li>n";
            endforeach;
            echo "</ul>n";
        endif;
    endif;
    ?>
    

    Source: http://wprecipes.com

    P.S. don’t forget that there is a dedicated SE for WordPress at http://wordpress.stackexchange.com