The 7 Closet: A022 Digital Blog

The coolest stuff from the internet? Nah, but we're glad you think so.

Quick Customization for Subscribe Remind Plugin

I love the Wordpress plugin Subscribe Remind- it is one of the few plugins I install by default with each new site I set up.  This plugin does a relatively small task but does it effectively in a way that you simply activate it and then never touch it again.

All it does is add a small snippet of text to the end of each post on your WordPress blog linking the reader to your RSS feed.  By default, it adds “If you enjoyed this post, make sure you subscribe to our RSS feed!”  You can easily customize this text by editing the plugin file and I’ve done this a number of times for various projects.

However I have recently been using Custom Post Types quite extensively and as a result needed to make a small customization to the Subscribe Remind so this text snippet wouldn’t get dropped in after every single type of post.

When you open the plugin file, you see lines 14-16 are:

if ( is_single() ) $content .= "\n\n" .       sprintf(SUBSCRIBE_REMIND_TEXT, get_bloginfo('rss2_url')); return $content;

To make sure the reminder text does not show up for a particular post type, simply edit line 14 so it looks like this:

if ( is_single() && get_post_type() != 'blog' )

‘Blog’ is my custom post type slug, so just replace that with whatever your slug is.  In plain English, this line of code says “If this is a single post page and (&&) the post type is not ‘blog’ (!= means ‘not’)…”

This is not a very advanced task at all but as more people start to use custom posts, this might be a small housekeeping task to consider.  Enjoy!