How to: Add a rss link on each post

Someone asked “How to create a rss link displayed on each post?”on WpRecipes forum. Althought this is very easy to do, many WordPress users seems to wonder how to do it. The answer is simple, read on!

To create a rss suscribtion link under each post, edit the single.php file from your theme.
Locate the WordPress loop, and simply add the link below.

<?php if (have_posts()) :
     while (have_posts()) : the_post();
         // WordPress loop ?>
         <div class="rss-box"><a href="http://feeds.feedburner.com/wprecipes">Enjoyed this post? Suscribe to my RSS feeds!</a></div>
        <?php endwhile; ?>
<?php endif; ?>

As you can see, I embedded the rss subscription link with a <div> html element. This way, it will be very easy to edit style.css and style it to fit your theme look and feel.

14 Responses

Oct 28 2008 09:07

Interesting. I am gonna give this one a go :)

Oct 28 2008 10:39

Glad you liked it, my friend!

Oct 28 2008 21:12

I would love to learn Wordpress code. Are you ever planing on holding some sort of class?

I specifically would like to learn how to create Wordpress themes and also how to manipulate Wordpress better. I would pay up to $20 a month for this type of learning. Maybe you can create some sort of membership site and teach different things. (wordpress blueprint)Each weeks brings a new lesson.

Or heck you can also tutor me privately. LoL. Let me know.

As for the tip above, very nice. I do know how to make certain changes to Wordpress code, such as adding Adsense in single post and pages. Adding various widgets and whatnot, etc.

But there is quite abit i still don’t know how to do. Currently i have to pay someone to make changes for me. For example, i recently purchased a header banner for a blog of mine, but have no idea how to add it.

It is a blog that uses the Fresh News Theme and if you care to share how to add it, the URL is listed below.

http://www.groovychicago.com

Missy.

Oct 28 2008 22:31

@Missy: I don’t think that i’ll run a WP class soon, but I can make some custom WP work for you. Email me if you need some “premium support” :)

To replace your header banner, open style.css and find #header h1. You just have to adjust the image url then :)

Oct 29 2008 12:01

Thanks. I’ll try for my blog :) .

Oct 29 2008 21:38

Thanks so much:)
it was me who asked this in forum,just i must have forgotten to type my name..
anyway..i’m really very pleased with this recipe:)

Oct 29 2008 21:51

this is the code i use for my site,
just i didn’t know where to put it but i know now thanks to Jean,

If you want to be notified for latest posts, sign up for email alerts or subscribe to the RSS feed. Thanks for visiting!

Oct 30 2008 00:42

Hi Jean,the code can’t be seen directly but its result is shown.could you fix it plz?

Nov 12 2008 07:06

What’s the wordpress loop? A ‘newb’ question I’m sure.

Nov 12 2008 11:56

@Keith W: You can find informations about WP loop here.

Nov 12 2008 21:25

Thanks for the link so I could figure it out, rather than just telling me!

May 09 2009 05:03

Thanks a lot of this tutorial, working very well. :)

Trackbacks:

Leave a Comment

* Name, Email, Comment are Required