WordPress.org

Ready to get started?Download WordPress

Forums

Dashboard Feeds on Static Page (6 posts)

  1. kabitzin
    Member
    Posted 9 years ago #

    Is there a way to have several personally designated RSS feeds show up on a static page the way the various WP related posts show up on the dashboard? Is there a way to color code them?

  2. Kafkaesqui

    Posted 9 years ago #

  3. davidchait
    Member
    Posted 9 years ago #

    If you're just looking for pretty darn simple RSS aggregation, there's CG-Feedread, part of the CG-Powerpack.

    The 'layout' portion is whatever you want to do with it. I don't know if they're using floats, or a table.

    -d

  4. kabitzin
    Member
    Posted 9 years ago #

    This plugin seems to modify the WP-Admin page, but I was hoping to duplicate (but with different rss feeds) the dashboard on a static page on my blog. Can this plugin do that?

  5. Kafkaesqui

    Posted 9 years ago #

    No it doesn't, but with some ingenuity and a little work you can reuse the Dashboard's functionality and roll your own. Here's a few hints:

    This needs to be somewhere in the template before the feed(s) appear:

    <?php require_once (ABSPATH . WPINC . '/rss-functions.php'); ?>

    A simple RSS "loop":

    <?php
    $rss = @fetch_rss('http://some.site/rss.xml');
    if ( isset($rss->items) && 0 != count($rss->items) ) {
    $rss->items = array_slice($rss->items, 0, 5);
    foreach ($rss->items as $item ) {
    ?>

    <a href="<?php echo wp_filter_kses($item['link']); ?>"><?php echo wp_specialchars($item['title']); ?></a>
    <?php } } ?>

    That 5 in array_slice($rss->items, 0, 5) indicates how many articles to call up. WordPress' RSS features are based on Magpie RSS, hence many of its variables etc. are there in WP.

  6. davidchait
    Member
    Posted 9 years ago #

    With CG-Feedread all you need is the plugin running (which you get if it's a page in wordpress, and you activate CG-Feedread).

    Then in the page template, you can do something like:
    <?php
    $feed = "some url";
    $rssout = getSomeFeed($feed, 5, false, 'some-feed');
    if ($rssout) echo $rssout;
    ?>

    You don't need to do any work. There are parameters for controlling the total number of items, whether to show content or just title, how many characters to clamp to, output formatting options, allow HTML in content (good for Flickr embedding), etc.

    Ping if you need help with it.

    CG-Feedread can also be included completely OUTSIDE of WP, if you want say a static homepage that grabs titles from a sub-blog or something like that.

    -d

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.