Once upon...

an evening boring, while I pondered bored yet pensive,
Over many a strange and intriguing page of neglected blogs.
Swiftly, my mind began thinking, thinking of creating
A place of solace, of mapping of my thoughts and creations.
So welcome dear guests, if my words entice you.

The Voice

My name is Sue, simply Sue, an average idealist, a young adult, still uncertain about my future. My art and writings are by no means professional, but my passion for creating, creating, and creating is the living force that makes this site possible.

The Layout

Tested on:
  » Firefox 2.0.0.14, Opera 9.10,
    Netscape 8.1, Safari 3.1.1,
    Internet Explorer 7.0
  » Screen res: 1280x800
  » Color Quality: 32 bit

Affiliates

« Dailies | Apply? »

[ CLOSE ]
Gallery Graphics Anime Forums
AddThis Feed Button Bookmark and Share

Creating a RSS Feeds Page

Have you ever wondered if there’s a way to create a page that displays all your friends’ recent entries so you don’t have to visit their sites individually every time you want to see if they have updates? Well, I have created just the post for you. I still need to find a way to display full entries though, and possibly categories the entries fall under, the author’s name, and a comments link with the number of comments already posted. Basically, I’m looking for something like Livejournal’s friends page or Xanga’s subscriptions page.

Here’s the bit of code you will be needing:

<?php
require_once (ABSPATH . WPINC . '/rss-functions.php');
$url = 'http://sue.com/feed/';
$rss = fetch_rss( $url );
if ( $rss ) {
echo "<h4>" . $rss->channel['title'] . "</h4>";
$i = 1;
foreach ($rss->items as $item) {
$href = $item['link'];
$title = $item['title'];
$pubdate = $item['pubdate'];
$author = $item['author'];
$category = $item['category'];
$description = $item['description'];
echo "<span style=\"font-size:16px\">$title</span><br /><b>$pubdate</b><br /><div style=\"padding:0 20px 0 20px\">$description</div>";
if ($i == 1 ) break;
$i = $i + 1;
}}?>

The only part you really need to change is the part that says
http://sue.com/feed/
Change that to whatever URL the feed page is to your friend’s web site. Usually they provide a link for you. If you have Firefox, you can view that page by clicking on the orange square icon on the very right of the address bar. Otherwise you can right click and view source to find where it says link rel=”alternate” and find the URL of the feed after that. Be sure it ends with rss, or feed. Somehow atom feeds don’t work with this code.

For each new feed URL you want on the page, you’ll need to copy and paste that code again and insert the URL.

For an example of a working Friends/Affiliates page, click here.

Edit on 1.30.2008: To display full entry feeds, use this bit of code in place of where it says $description = $item['description'];

$isset = $item['content']['encoded'];

and replace where it says $description with $isset.

To display the author’s name use this:

$author = $item['dc']['creator'];

And be sure to include echo “Author: $author”;

Oh yeah, and here are the instructions for how to apply the code:

To set up the dailies page, you need to create a template. Let’s call it “Feed”. To create a template, basically copy the code from page.php or if you don’t have that use index.php, but delete wherever they call the comments function, the date, and anything else you don’t want to show up on your dailies page.

Create feed.php with that copied code from page.php or index.php. At the top you should write <?php /* Template Name: Feed */ ?> or whatever you want the template name to be. Then you should paste that bit of code I mentioned in this post in place of where it says <?php the_content(); ?> or something similar to that.

Create as many duplicates of that bit of code as there are feeds you want to read from people. It only creates one entry per site. Be sure to replace the URL with whatever feed URL you want. After that, save the feed.php, and upload it on your server under your theme’s folder.

Then create a page in Wordpress, and name it “Dailies” or something like that. Be sure to select the template “Feed”. You don’t have to write anything on that page. Hit publish, and you should be able to view that page.

Similar Posts

Simple Site Map Plugin,

18 Comments

Thank you for taking the time to leave a message. Your comment is much appreciated. Also, please leave a comment relevant to the posted topic. If this is your first time commenting, your comment will be held for moderation before being displayed. If you would like a custom avatar to appear beside your message, please sign up for an account on Gravatar
  1. Chien Yee Identicon Icon
    Chien Yee on 01.24.2008 at 20:41 (Reply)

    I think you mean we should change http://x.nuwen.com/feed/ ;)

    1. Sue Identicon Icon
      Sue on 01.24.2008 at 20:43 (Reply)

      Sorry. I had the other link there but then somehow I copied and pasted the wrong code when I edited the post. It’s changed now though.

  2. Xuan Identicon Icon
    Xuan on 01.24.2008 at 21:45 (Reply)

    Ooh, nifty! Thanks for the code tidbit. :)

  3. Brenda Identicon Icon
    Brenda on 01.24.2008 at 23:41 (Reply)

    Hehe, I just use Google Reader. :P Instant live updates!

    But that looks like a nifty piece of code. Perhaps I’ll try it out one day if I have the time.

  4. stanch Identicon Icon
    stanch on 01.25.2008 at 15:22 (Reply)

    it look like “get recent posts from feed” plugin :) anyway, thanks fro this post, still useful :)

  5. Angela Identicon Icon
    Angela on 01.25.2008 at 17:52 (Reply)

    This is wonderful. I’m planning on using it. This would save me so much time, cause I like to check my affiliates/link exhanges at LEAST once a week. I know that’s not alot, but I try for more.. and now with this I’ll be able to. Thanks :P

  6. Yara Identicon Icon
    Yara on 01.27.2008 at 10:54 (Reply)

    Ahaha thanks for telling me :) Well anywho I won’t be updating my wordpress site anymore, because I finally got the hosted one up :). You can change my link if you want, I’ve put up yours on mine :). Anyways, I think that I’m a tad old-fashioned considering the fact that I just visit the site to see if there are new updates. I find it more fun, for some odd reason :P.

  7. Brenda Identicon Icon
    Brenda on 01.27.2008 at 13:42 (Reply)

    Hey Sue! In response to your question, I use an archive plugin called Clean Archives Reloaded. (:

    Here’s the link for your reference:
    http://www.viper007bond.com/wordpress-plugins/clean-archives-reloaded/

    (*Hopes that this wouldn’t break your site structure. :(*)

    1. Sue Identicon Icon
      Sue on 01.28.2008 at 19:25 (Reply)

      Thanks for the link Brenda. I ended up finding one myself though, called wp collapsible archive. It shows the number of posts per year, then when you expand that, it shows number of posts per month, and then under each month it shows the posts. You can view entries by year, month, and day, and it’s a widget, which I just figured out how to use so I’m pretty excited.

  8. Destiny Identicon Icon
    Destiny on 01.28.2008 at 11:59 (Reply)

    Wow, thanks for this post!! I never thought of doing that, but it looks awesome!! I might do that for my next layout, not quite too sure yet!

  9. lisadragon Identicon Icon
    lisadragon on 01.29.2008 at 19:29 (Reply)

    Hi Sue, I found your site through WP Forums, dropped you a question there but I figure I’d try here too. I’m curious as to how you created the Dailies page - was it using the “Page” feature in WP or using a plugin, if so, which one?

    Thank you so much,
    Lisa

    1. Sue Identicon Icon
      Sue on 01.29.2008 at 22:39 (Reply)

      I created a template and named it feed. In that template I basically used the page template but in place of where it says < ?php sf_content(); ?>I used the bit of code mentioned above as many times as I have feeds. I then created a page named dailies, in which I wrote nothing, but I used the feed template.

      1. lisadragon Identicon Icon
        lisadragon on 01.30.2008 at 04:54 (Reply)

        It worked great! Thanks a lot ^__^

  10. Kimberly Identicon Icon
    Kimberly on 01.30.2008 at 17:43 (Reply)

    Wow did you come up with that?
    That’ll come in handy some day. =)

  11. Destiny Identicon Icon
    Destiny on 01.31.2008 at 10:55 (Reply)

    Thanks for your input! Hopefully I fixed it so that it is viewed a bit better!!
    Do you really use the RSS page?? ^_^
    It’s an awesome tutorial but I don’t know where I would add it ^_^

  12. bec Identicon Icon
    bec on 02.01.2008 at 05:38 (Reply)

    woah. neat gimmick. i’ll try that out sometime. :D

  13. Katie Identicon Icon
    Katie on 02.01.2008 at 17:33 (Reply)

    Oooh, thanks for the code! Sounds really useful, will have to try it out sometime. :)

    I love your layout.

    Take care,
    x x x

  14. Roz Identicon Icon
    Roz on 02.01.2008 at 19:16 (Reply)

    Whoa..that is pretty cool. I think I’m going to have to try that out some time; it seems like a huge timesaver and a good idea. Thanks!

Leave a comment

Quicktags: