How to Make Your WordPress Posts Printer Friendly

August 11, 2016

Nearly all web browsers feature the option to print web pages, which will likely include a screenshot-like summary of what your viewers see in their browser. Unfortunately, this includes all your website’s content, including the menus, graphics, sidebars, footers, etc.

Let’s face it, printer ink is expensive and who wants to print one page worth of content on eight pages?

As with any problem that arises in the world of WordPress, developers have created plugin solutions that enhance the functionality of your website by allowing you incorporate the option to “print this post” within WordPress, thereby making your posts printer friendly. In addition to a courteous gesture, these plugins enabling your viewers to print the content they want with the click of a button.

Of course, one could create a separate CSS file with styles specifically coded to enable browsers to format a printed page, but who would put themselves through such a cumbersome process when you can easily and swiftly install a printing plugin? While there are likely many printing plugins for WordPress, we suggest installing the WP-Print plugin based on its respective features, friendly interface, and ease-of-install.

In this tutorial, we’ll show you how easy it is to place a “Print this Post” button into your post using the WP-Print plugin.

Step-by-step Installation Process

Installing the WP-Print in WordPress

Among the many options for downloading and installing plugins, we’ll cover two options that explain how to download and upload the WP-Print plugin.

Option 1 – From within the WordPress Admin Panel

  • Login to your WordPress admin account to access the dashboard.
  • Select Plugins from the left-side navigation menu and select [Add New].
  • Using the search feature built-in plugin directory, type “WP-Print”.
  • The first suggestion should be the WP-Print plugin. Simply click the [Install Now] button.
  • You’ll receive a confirmation notice once the installation is complete . Click the [Activate Plugin] link.

Option 2 – Manually install it through your FTP Client

  • Click here to locate the latest version of WP-Print from the WordPress.org Plugin Directory.
  • Click the orange download button to the right of the plugin’s description.
  • Once the files have been downloaded, extract the files to create a folder on your desktop. By default, the folder with the files should be named “wp-print”
  • Log into your website’s files via your FTP client and navigate to the folder entitled /wp-content/plugins/
  • Upload (drag and drop, if applicable) the “wp-print folder” to /wp-content/plugins/
    Login to your WordPress admin account and select Plugins from the left-side navigation bar
  • Locate the WP-print plugin and click [Activate]

Enabling printer-friendly links using the WP-print plugin

As with the installation process, there are two ways to enable printer-friendly links in WordPress, namely 1) the easy way by prompting which specific posts you want to have the printer-friendly link, or 2) the more complicated method of modifying your theme’s code to automatically include the print button on every post.

Method 1 – Easy

Once the plugin is activated, you can add a the “Print This Post” link to each post. Simply type in:

[print_link]

anywhere you like within your posts content.

The result will appear as follows:

Screen Shot 2016-08-08 at 12.21.00 AM

Method 2 – Modifying Code

Rather than entering the [print_link] command into every post, you can modify your theme’s PHP files to automatically include the “Print This Post” link on every post. The instructions from the developer, Lester Chan, on how to do this are as follows:

Open:
wp-content/themes/<YOUR THEME NAME>/index/php

You should place it in single.php, post.php, page.php, etc also if they exist.

Find:
<php while (have_posts()): the_post()>

Add Anywhere Below It:
<?php if(function_exists('wp_print')) { print_link(); }>

  • The first value is the text for printing post.
  • The second value is the text for printing page.
  • Default: print_link(”, ”)
  • Alternatively, you can set the text in ‘WP-Admin -> Settings -> Print’.
  • If you DO NOT want the print link to appear in every post/page, DO NOT use the code above. Just type in [print_link] into the selected post/page content and it will only embed the print link into that post/page.

Excluding Certain Content from Printing

If you would like to exclude certain content from being printed, you can place the commands [donotprint] [/donotprint] before and after the content, respectively. When viewing the printer-friendly version of your post, the text between these commands will be excluded; however, it will still be displayed as normal when viewing the post through a web browser. Any text within these commands will also be excluded when emailing the post. Below is an example of the text exclusion command:
[donotprint] The text that is entered between these two tags will not be displayed when printing or emailing [/donotprint]

Leave a Reply

avatar
  Subscribe  
Notify of
Help
Leave us a message