8

Easily Add A Subscribe To Feed Reminder To The Bottom Of Your Posts

Learn how to add custom content like a RSS subscribe reminder box to the bottom of your WordPress posts for your readers to see once they finish reading posts. This is a quick and easy way to add whatever you want below your posts....
Easily Add A Subscribe To Feed Reminder To The Bottom Of Your Posts

Why Would You Do It?

Once your readers are finished reading an article on your site, what's next? Subscribe to the RSS feed!! Adding a little reminder for people to subscribe to the feed once they finish reading your post is a prime location for such a reminder, and can be a great way to gain regular readers of your blog posts and visitors to your site.

You might have noticed the little reminder to subscribe at the bottom of posts on this site.
rss-box
The question of how to do this was posed in a comment on another post, so I figured it would be good to write a post on it.

Keep in mind that this trick can be used to add anything you want to the bottom of your posts, not just a feed subscribe box. That I leave up to you.

The Styles Make Smiles

RSS ImageHere's the RSS icon image. The code for styling the box shown on this site is pretty basic, and somewhat generic. You could use it as is or alter it to fit your needs.

.rssbox {
	background: #e4e4e4 url(images/rss-feed.png) no-repeat left top;
	background-position: 20px 7px;
	border: 1px solid #121a24;
	padding:5px 10px 5px 80px;
	margin: 0px;
	font-size: 16px;
	line-height: 23px;
	color: #121a24;
	height:50px;
	width: 472px;
	overflow:hidden;
}
.rssbox a {
	color:#FF7600;
	text-decoration: none;
	font-weight:normal;
	text-shadow:0 1px 0 #FFD563!important;
}
.rssbox a:hover {
	color:#133DF2;
	text-shadow:0 1px 0 #398CFF !important;
}

A Function Or Something

This function can be added to your functions.php file. It is basically just outputting the HTML code which contains the content for my RSS box. You can show whatever you want by putting it within this function..

/* Create RSS Box at bottom of single-posts */
function postBottomBox() { ?>

	<div class="rssbox">
	Get automatic updates! <a href="http://feeds.feedburner.com/New2WP" target="_blank" rel="bookmark">Subscribe to Our RSS Feed</a> or <a href="http://feeds.feedburner.com/fb/a/mailverify?uri=New2WP" target="_blank">Get Email Updates</a> sent straight to your inbox!
	</div>

<?php } /* end of RSS box */ ?>

Making It Dance And Sing

You can make it show on the page using two different methods. I personally like to have full control of the order and placement of things whether it's a plugin or a custom function. That is why I use the first example here. You have the ability to place it right where you want to it to display this way.

In your single.php template of your theme, add this below the function the_content() where ever you'd like it to display. This checks if the function exists, in the case that it doesn't for some reason which would break the theme, and then calls the function if it exists.

<?php if (function_exists( 'postBottomBox' )) { echo postBottomBox(); } ?>

The other way you could make it display is by adding a filter to hook into the single template functions.

// Use this to add it to the bottom of the post content
add_filter( 'the_content', 'postBottomBox' );

// Use this to add it just above your comments
add_filter( 'comments_template', 'postBottomBox' );

You don't have as much control using add_filter() though. Many plugins use them to display whatever they display, most commonly, the_content().

This is used by similar post plugins for example, and I'm sure many others. The New2WP Author Box plugin uses the 'comments_template' hook, which I chose to do because at the time I wanted the author bio box to display below all other possible content added by plugins such as similar posts. For me personally and logically, seeing other similar posts would be more interesting as a reader than a box showing a bio about the post I just read. However, using the comments template hook sometimes causes problems with more complex themes.

So What To Do Now??

Well that's a no-brainer.... Subscribe to the Feed!!

Here's a list of our feeds which you may be interested in for those who are only really interested in getting updates for one type of thing and not all new posts and other updates.

Hope this has helped you customize your posts with some nifty additions to the bottom of your posts!! Feel free to comment with any questions or other thoughts below.

Shortlink:

Get automatic updates! Subscribe to Our RSS Feed or Get Email Updates sent straight to your inbox!

About the Author

Jared is from Boston working as a web and graphic designer. Also owns the design blog Tweeaks.com, and has designed many other websites powered by Wordpress including the New2WP theme.

Level: Noob

User Comments

( ADD YOURS )
  1. mssbee July 14


    Thanks for the great post. I am working at learning PHP and your tutorial is most helpful.


  2. Happy to help :) You will probably like the post series I'm working then too.


  3. great thanks


  4. i still could not do it lol, where do i put what? i am completely noob on this


  5. If you have ftp access to your theme files, then you just need to edit the files, functions.php, single.php, and style.css

    The first piece of code that starts with: .rssbox { background: #e4e4e4 url(images/rss-feed.png) no-repeat left top;

    you add that code anywhere in your style.css file, I would just add it to the very bottom of the code after everything else.

    The code that has the: function postBottomBox() { ?>

    This needs to be added to your functions.php file, anywhere as long as it's not within a function. If you see something like function somename() {
    Put it right before that, so it is not within a function but right before one.
    You could also add the very last code to right before the function along with it too instead of editing the single.php.

    If you choose to edit the single.php file, find where it says the_content() and add this after it.
    < ?php if (function_exists( 'postBottomBox' )) { echo postBottomBox(); } ?>

    Once you do that, save the files, and ftp them to your theme. You can always just remove the code you added if something breaks, it's no big deal.


  6. wow,, very awsome for me... :D
    i try your post in my blog now... :D
    amrikarisma recently posted..Indonesia Siap Bersaing di SERP


  7. hello, when i put this on my functions.php file . It shows there RSS Box but the content of the original post is gone away..

    function postBottomBox() {?>

    Get automatic updates! Subscribe to Our RSS Feed or Get Email Updates sent straight to your inbox!

    <?php } /* end of RSS box */
    // Use this to add it to the bottom of the post content
    add_filter( 'the_content', 'postBottomBox' );
    // Use this to add it just above your comments
    add_filter( 'comments_template', 'postBottomBox' );

    Thank you

Trackbacks


  1. Avatar

    Your Name
    May 17


    CommentLuv badge