Forums

Multiple RSS Feeds for different WP Pages (7 posts)

  1. Mark
    Member
    Posted 5 years ago #

    Hey all. What I am trying to do is this:

    I have a page setup with these different Categories:

    National
    Sports
    Religion
    Entertainment
    Money

    When someone clicks on "National" I want several RSS feeds to pull into that page displaying national news. So on and so forth with the other pages.

    I am not looking at stealing RSS feeds. But I would like to display each "story" as its own post. There are several plugins out there but I'm not sure which one I should use. I started using FeedWordPress but I don't think it can do what I'm looking at doing.

    Does anyone have any suggestions?

    Thank you!

    -Mark

  2. Otto
    Tech Ninja
    Posted 5 years ago #

    I would write your pages using the RSS reading functions and make the output look like your normal posts output.

    See here: http://codex.wordpress.org/Function_Reference/fetch_rss

  3. Mark
    Member
    Posted 5 years ago #

    But how do I get different RSS feeds for different pages. I understand about the Fetch RSS but I don't get how to get a different RSS feed for different pages.

  4. Mark
    Member
    Posted 5 years ago #

    Would I just simply create other "template" pages and have a different set of PHP code like this?

    <?php
    require_once(ABSPATH . WPINC . '/rss-functions.php');
    $rss = fetch_rss('FEEDURL');
    echo '

    ';
    ?>

  5. Otto
    Tech Ninja
    Posted 5 years ago #

    You could do it in one of several ways. You could code a different template for each page. That would be simplest.

    For a large number of pages, you could be clever about it and code the template to pull out the page's content, parse it into a list of URLs, and get those URLs.

  6. Mark
    Member
    Posted 5 years ago #

    Is there an easy way to show a set amount of data for each post instead of just the links?

  7. Otto
    Tech Ninja
    Posted 5 years ago #

    You can show anything you like, as long as it's in the feed.

    Try adding var_dump($item) to your foreach loop. This will dump all the data it pulled out of the feed item to the output, letting you see what is available. In the same way that you echo $item['title'], you can echo other stuff as well, and that will show you what's in there.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags