WordPress.org

Ready to get started?Download WordPress

Forums

Rss on page (8 posts)

  1. piperis
    Member
    Posted 5 years ago #

    Hello,
    I am kinda new to WP, and would like to find out how i can have an rss feed displayed on a page. (example: a bit like on the dashboard with the WP development blog)
    Hope its possible....

    thanks

  2. piperis
    Member
    Posted 5 years ago #

    i just realised it can be done through a widget on the sidebar.. but how can i get it onto a page?

  3. piperis
    Member
    Posted 5 years ago #

    i have tried a few plugins but non have worked... there must be some sort of code that can be insterted into a post to get rss feed....?
    I really need this feature... ahhhh

  4. patrickdappollonio
    Member
    Posted 5 years ago #

    Two options: use the plugin can write PHP code and run them, and other, adding directly the code to your theme.

    The code necesary to do this is like this:

    <?php
    include_once(ABSPATH . WPINC . '/rss.php');
    $rss = fetch_rss('YOUR_RSS_FEED_TO_BE_PARSED');
    $maxitems = 8;
    $items = array_slice($rss->items, 0, $maxitems);
    ?>

    When "YOUR_RSS_FEED_TO_BE_PARSED" is the URL address of the feed you want to fetch.

    Try, and tell me what's happened.

  5. piperis
    Member
    Posted 5 years ago #

    where do i need to add this code?
    I only want one particular page to display the feed...

  6. piperis
    Member
    Posted 5 years ago #

    i cant enable any kind of widget as i dont have a sidebar... does that matter?
    I tried adding the code to the HTML part of the page, but it did nothing, just displayed the code...

  7. patrickdappollonio
    Member
    Posted 5 years ago #

    Its not HTML, you need to add them in the theme editor in any place you want to show.

    The widgets only support HTML Code, if you want to put them, you need a plugin to run PHP Scripts, but I can't remember what's the name of this plugin :P Try to find them in Google

    http://www.google.com/search?q=php+wordpress+run

    Or something like this :P

  8. Fokissed
    Member
    Posted 5 years ago #

    Hey Patrick,

    I tried adding the code you suggested directly to a Page Template, but it doesn't seem to be drawing the feed, because the space is completely blank.

    Here's the code I entered into the Page Template where PHP should be accepted:

    <?php
    include_once(ABSPATH . WPINC . '/rss.php');
    $rss = fetch_rss('http://www.livestrong.com/thedailyplate/diary/rss/Fokissed/');
    $maxitems = 8;
    $items = array_slice($rss->items, 0, $maxitems);
    ?>

    And here's the page where it should be showing up, but it's not:

    http://www.geek2freak.com/diet-log/

    Any help would be greatly appreciated.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags