Free Wordpress Blog Setup

How to Add a Printer Friendly Option to Your WordPress Posts

By Editorial Staff in Wordpress Plugins
How to Add a Printer Friendly Option to Your WordPress Posts

If you have a blog that has recipes, or music notes that people can print and use, you want to offer them a way to print that page or post. Not just recipes, or notes, some audiences just love to read in print version. Therefore you need to allow your users to be able to print the article or page. In this article we share a plugin called WP-Print that makes your posts printer friendly by displaying a printable version of your posts without other useless information on the post such as ads and other.

To install WP-Print, you need to download it, and then activate it.

Once done, you would need to regenerate your permalinks. You can do this by going to:

WP-Admin > Settings > Permalinks > Save Changes

You do not need to make any changes, but you must hit the save button. (Check out an article about SEO Friendly Permalink Structure in WordPress)

Once that is done, you may go to your themes folder:

/wp-content/themes/Yourthemename/

And you must place the plugin code in the files of your choosing, it can be: single.php, page.php, post.php, loop.php.

You need to find this code:

<?php while (have_posts()) : the_post(); ?>

Paste the following code in the loop:

<?php if(function_exists('wp_print')) { print_link(); } ?>

This will display a Print option to all your posts and pages if you add it. If you do not want to display it in all posts, you must not add this code in your theme files. Instead what you can do is, Add the following code in the individual post: [print_link] and this will add the print option to that post.

You can configure other styling options from your Settings page located at WP-Admin > Settings > Print.

WP-Print Settings

If you do not want a specific part of your post to be viewed in the printer friendly version, you can add the following tags around that area:

[donotprint][/donotprint]

By doing so, the text will still show to all readers in the web version, but it will not when the printer friendly version of a post is generated.

WP-Print will load ‘print-css.css’, ‘print-posts.php’ and ‘print-comments.php’ from your theme’s directory if it exists. If it doesn’t exists, it will just load the respective defalult file that comes with WP-Print. This will allow you to upgrade WP-Print without worrying about overwriting your printing styles or templates that you have created.

WP-Print

Free Wordpress Blog Setup

Comments

One Response to “How to Add a Printer Friendly Option to Your WordPress Posts”
  1. kovshenin says:

    My opinion? The plugin needs more work in the multilingual world. I had to hack into the code to get it working for me, which is not very cool… Other than that, it’s okay ;)

Share Your Opinions

Tell us what you're thinking...
and if you want a pic to show with your comment, then get gravatar!

Please make sure that you have read our Comment Policy.

Due to high volume of request from our readers, we are adding this feature that allows you to stay updated with this post's comments without having to participate in the discussion even though we would love your input as always. Don't worry we hate SPAM just as much as you do, so you will never receive any SPAM messages from our site and that's our promise to you.

Subscribe without commenting

Close Bar