Quick Links: WP-Email, WP-Print
So I was setting up my website with a new WordPress install and wanted to give the reader a link to either email or print the page of interest. So I did some searching and found two great plugins for WP.
The email plugin is simply called WP-EMail developed by Lester ‘GaMerZ’ Chan (http://lesterchan.net/) and you can find the latest build on his website. To install this on your blog, download the plugin, extract it to your hard drive somewhere, upload the plugin into the wp-content/plugs directory. Then go to your plugin manager and activate it. Once its activated, you need to update your permalinks. This is easily done by going to options, permalinks, and click on the button in the upper right that says “Update Permalink Structure.” Once that is done, you will need to download two files from your theme (that is if you dont keep a local copy on your hard drive). The two files needed are Page.php and Single.php. You will find those in wp-content/themes/your-theme-name. Download those and open them in a text editor, or your code editor and find:
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
and paste after:
<?php if(function_exists(’wp_email’)) { email_link(); } ?>
Once you have found it you are free to paste this code where ever you want the link to show up. I wanted to have the link show up at the bottom of the page, so I put it just after
<?php endif; ?>
Now keep in mind I did this to both files: Page.php and Single.php
The Print link is just about the same, except you will use the WP-Print plugin and paste this code:
<?php if(function_exists(’wp_print’)) { print_link(); } ?>
after
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
So I wanted a cleaner look and have both links show up on the same line, so I just created a small table for both links:
<table border=”0″ cellpadding=”0″ cellspacing=”0″ width=”350″><tbody>
<tr>
<td><?php if(function_exists(’wp_email’)) { email_link(); } ?></td>
<td><?php if(function_exists(’wp_print’)) { print_link(); } ?></td>
</tr>
</tbody></table>
I put this just after the
< ?php endif; ?>
And now I have a two links at the bottom of each post and page to email and print. How cool is that?!?
Thanks to Lester ‘GaMerZ’ Chan for providing this for us to use.
