The MU forums have moved to WordPress.org

Displaying RSS on Page (9 posts)

  1. RaceDay
    Member
    Posted 18 years ago #

    I can get the RSS to show by using external sources, and pasting a code into my sidebar--but isn't there a way to do this internally? Example: Right sidebar on this page:
    http://www.racedaynews.com/jhanna

  2. drmike
    Member
    Posted 18 years ago #

    If you want it in a page, you could create your own Page Template, paste in the code from the RSS widget, and then just create your own page using that Page Template.

  3. ergate
    Member
    Posted 18 years ago #

    I got this from the regular WP.org support forum,

    "RSS is already built into wordpress, you don't necessarily need a plugin for it. Just use the MagpieRSS functions.

    require_once(ABSPATH . WPINC . '/rss-functions.php');<br />
    $rss = fetch_rss($url);<br />
    foreach ($rss->items as $item ) {<br />
    echo "<a>".$item['title']."</a>";<br />
    }

    You can do a var_dump($rss->items) for testing, to see what information you have available to you in the feed."

    along with
    Q = "Are MagpieRSS functions built into WordPress?"
    A = "Yep. Look in /wp-includes/rss-functions.php."

    These posts were cut from here
    The rest of the thread is not relavent to this.

  4. RaceDay
    Member
    Posted 18 years ago #

    I feel like an idiot as the above message flies over my head. I know I really need to learn more. But I don't get the var dump and what to do with the code...

  5. samchng
    Member
    Posted 18 years ago #

    This thread's interesting, would like to know more about RSS on a page too. :)

  6. samchng
    Member
    Posted 17 years ago #

    ergate, try it before with any luck on what you posted above?

  7. andrea_r
    Moderator
    Posted 17 years ago #

    I think what ergate means is you have to plunk that code right in a template - one that is unavailable to other users or they'd get it too. :)

  8. samchng
    Member
    Posted 17 years ago #

    Added this to a pagetemplate.
    <?php
    require_once(ABSPATH . WPINC . '/rss-functions.php');
    $rss = fetch_rss($url);
    foreach ($rss->items as $item ) {
    echo "".$item['title']."<br>";
    }
    var_dump($rss->items);
    ?>

    Got this error. :)

    Warning: Invalid argument supplied for foreach() in /home/bizblogo/public_html/wpmu/wp-inst/wp-content/themes/businessworld/rss.php on line 13
    NULL

  9. samchng
    Member
    Posted 17 years ago #

    Ops BBpress got it....but it's a smilar code to ergate's...

About this Topic