WordPress has become a standard if not the standard template based blog and website platform. It is written in PHP, is very easy to edit and customize with a plugin or two, and with the available themes, there is very little it can’t do. For those who have not tried setting up a WordPress site, it can be intimidating in the beginning. The good news is that there is so much knowledge out there available for free that can help you, so many free themes that look great, and many people that would be more than happy (for a fee) to help you. I have been programming for years and was very intimidated when I started my WordPress site. The more you work with it, the more you understand.
Plugins add flexibility
There are many plugins that can help you with your site. Some are good, some are bad. I would like to describe how I use and have modified a few of the plugins I have found. The one I would like to discuss today is Bottom of Every Post by Corey Salzano. This plugin is simple. It was created, in the authors words, because the others were too complex. I liked it for that same reason, simplicity. To install and get the plugin up and running, there are a few simple steps:
- Download the plugin (via your WordPress Admin dashboard) and activate it
- Go to Plugins->Editor and select the Bottom of Every Post plugin
- Read the readme.txt for instructions to the plugin.
- Add whatever text you want into bottom_of_every_post.txt. That text will be included at the end of each post
The setup is simple, easy, and quick. The plugin works great for text, but I wanted to put links, dynamic titles, etc. So, I went to digging and modifying the code. The result is here to the right (or here if you don’t see it). The main differences that my editing accomplished is as follows:
- I wanted to have the title of the post and have it linked (for RSS feeds and such)
- I wanted to have a Call to Action for comments, sharing on Facebook, and an RSS feed
- I wanted the text to be as dynamic as possible
The Code Mod
To accomplish this, I had to modify the code. I abandoned the bottom_of_every_post.txt file for my message and inserted it directly into the plugin code. That way, I could take advantage of the global variables and everything else WordPress has to offer. Specifically, here is what I added:
$post_title = get_the_title();
$post_link = get_permalink();
$msg = “<blockquote><i>Thanks for reading <strong><a href=’” . $post_link . “‘>” . $post_title . “</a></strong>. I would appreciate your comments and feedback on this post. If you like the post, please <a href=’https://www.facebook.com/sharer/sharer.php?src=bm&u=” . $post_link . “‘>share it</a> with your friends. If you want to read more, <a href=’http://feeds.feedburner.com/BlueCapra’>subscribe to the RSS feed</a>. Have a great day.</i></blockquote><br>”;
Here is a rundown of what this code does; $post_title gets set with the title of the post, $post_link gets the permalink of the post, $msg gets the text I want, in <blockquote> to indent it a little and change the style. The plugin then returns the contents of the post and concatenates (or adds the text contents of the variable to the end) the $msg variable to it, so it will appear at the end. There may be a more elegant way of doing parts or the whole thing, but this works great for me. I am often modifying the wording to get it just right.
So, that is how I use the WordPress plugin Bottom of Every Post. I hope this information will help you with your own website. Good Luck
For other WordPress How-To articles, check out the related post section below or in the right sidebar or click here.
My WordPress How-to: Bottom of Every Post by Alan Reeves