WordPress.org

Ready to get started?Download WordPress

Forums

please help regarding MagpieRss (2 posts)

  1. itssami
    Member
    Posted 8 years ago #

    I want to display the rss feeds on my website.I installed magpierss and on my page (where i ant to print news , ) i wrote the following code.
    It works fine.ONLY only thing is missing, the following code gives only the news WITHOUT link to the full articles.I mean how i can add hyperlinks, so that every news is linked to the orignal article.
    Please help me :(

    code:

    require_once('magpierss/rss_fetch.inc');

    $url="http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/uk_politics/rss.xml";
    $num_items = 5;
    $rss = fetch_rss($url);

    $items = array_slice($rss->items, 0, $num_items);

    foreach ( $rss->items as $item ) {
    echo $item['title'];

    //echo "Published: " . date("h:i:s A", $published);
    echo "
    ";
    }

  2. Austin Matzko
    Member
    Posted 8 years ago #

    Try $item['link']

Topic Closed

This topic has been closed to new replies.

About this Topic