Support » Themes and Templates » Display RSS content including author in sidebar

  • I want to display a list of recent posts from another WordPress blog I have, using the other blog’s RSS. I’d like the display to read:

    Post 1 Title, by Author 1.
    Post 2 Title, by Author 2.
    Post 3 Title, by Author 3. … etc.

    How do you get the author from the RSS Feed?

    Here is what I’m trying to do:

    <h2><?php _e('Latest BTB Diaries'); ?></h2>
    <?php // Get RSS Feed(s)
    include_once(ABSPATH . WPINC . '/rss.php');
    $rss = fetch_rss('');
    $maxitems = 5;
    $items = array_slice($rss->items, 0, $maxitems);
    <?php if (empty($items)) echo '<li>No items</li>';
    foreach ( $items as $item ) : ?>
    <li><a href='<?php echo $item['link']; ?>'
    title='<?php echo $item['title']; ?>'><?php echo $item['title']; ?> by <?php echo $item['dc:Creator']; ?></a></li>
    <?php endforeach; ?>

    dc:Creator returns null, which leaves the “Author” blank. What am I doing wrong?

  • The topic ‘Display RSS content including author in sidebar’ is closed to new replies.