Affichage des articles dont le libellé est Friendly. Afficher tous les articles
Affichage des articles dont le libellé est Friendly. Afficher tous les articles

samedi 12 novembre 2016

How to Add a Printer Friendly Option to Your WordPress Posts



Often users want to print articles they find interesting. By default, WordPress itself and most WordPress themes would print your page as it is, with all the graphics, colors, and text in sidebars. In this article, we will show you how to add a printer friendly option to your WordPress posts.


Adding a printer friendly option to WordPress posts


Why and When You Need a Printer Friendly Option for WordPress Posts?


Some WordPress themes come with a separate CSS stylesheet for printing. This stylesheet is used when a user prints a page. Other WordPress themes, may not change your site’s appearance when a user prints it.


Usually this results into users printing all the images, sidebars, headers, menus, etc. Most of the time it is not very pleasant to read or look at.


A typical print preview with sidebars forms all printed


You can see how your WordPress theme handles print by pressing CTRL+P when looking at a page from your site. Your browser will show print preview of your site.


If your theme shows your site as it appears in the browser, then it is not handling print any differently.


In that case, you can use a printer friendly option on your WordPress site. It will not only make your content printer friendly, it will also encourage users to print with an on-screen print icon.


We will be showing you two plugins that can add a print option to WordPress, and you can choose the one that best suits your need.


Method 1: Add Print Button in WordPress with Print Post and Page Plugin


This method is recommended for users who do not want to add code to their WordPress theme files.


First thing you need to do is install and activate the Print Post and Page plugin.


Upon activation the plugin will add a new menu item labeled ‘Print’ to your WordPress admin bar. Clicking on it will take you to the plugin’s settings page.


Print settings


Here you can choose the print icon size and color, text to accompany the icon, and print alignment. Optionally, you can add custom CSS that you want to include into your print template.


Don’t forget to click on the ‘Save and Activate’ button to store your plugin settings.


You can now visit your WordPress site and you will see a print button on your single posts.


Print button in WordPress post


However, the plugin does not automatically adds print button to your WordPress pages. You will need to add [printicon align="left"] shortcode to your WordPress pages to display the print icon on pages.


Method 2: Adding Printer Friendly Option Using WP-Print


First thing you need to do is install and activate the WP-Print plugin. For more details, see our step by step guide on how to install a WordPress plugin.


Upon activation, you need to visit Settings » Print to configure plugin settings.


Print Options


You can display print icon with text, just the icon, or just the text. You can choose between two icons, and you also change the text that appears with the icon.


Under print options, you will be asked if you want to print comments, links, images, or videos. By default, the plugin does not print comments and videos. You can change that if you want the plugin to print comments and videos as well.


At the bottom of each printed post, the plugin will add a disclaimer/copyright text. By default, it will show your site’s name. You can change that to anything you want, and you can also use HTML tags inside the disclaimer field.


Don’t forget to click on the save changes button to store your settings.


Now comes the tricky part. The plugin will not actually add the print button into your posts. You will have to manually edit your WordPress theme files to add the button.


Depending on your theme, you may need to add the code into single.php, page.php, archive.php, content.php, etc.


Locate the line in your theme template that looks like this:


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

Below this line, you need to add the following code where you want to display the print button:



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

That’s all, you can now visit your website and you will be able to see the print button.


Print this button


Sometimes you may have content that you do not want to be included into the print version. Simply wrap that content between [donotprint] and [/donotprint] shortcode, like this:



[donotprint]This text will not be displayed when printing[/donotprint]

We hope this article helped you add a printer friendly option to your WordPress posts. You may also want to see our guide on how to add PDF download for posts in WordPress.


If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.


The post How to Add a Printer Friendly Option to Your WordPress Posts appeared first on WPBeginner.







Save the earth, pick an environmentally friendly web host



alt="Save the earth, pick an environmentally friendly web host" src="http://whsr.webrevenueinc1.netdna-cdn.com/wp-content/uploads/2013/07/greenhosting-500x260_c.jpg" />

class="border" src="http://www.webhostingsecretrevealed.net/images/2009/0611-1.jpg" alt="Green Web Hosting" width="750px" />

Do you know web hosting is estimated to be as polluting as the airline industry in year 2020?

According to href="http://www.pcadvisor.co.uk/news/index.cfm?newsid=103005">Amenworld’s recent study of over 3,500 web servers, a single web server needlessly consumes 1,000 kWh on average, producing more than 630kg of CO2 annually. The figures are certainly shocking – it’s hard to believe hosting websites on the Internet can cause such damage to our earth.

“Like other industries, the hosting industry has a role in the global effort to reduce levels of carbon dioxide emitted into the atmosphere,” said Amenworld’s UK country manager Olivier Djidjelli.

Fortunately we are seeing more hosting companies taking up their responsibility in reducing the level of carbon dioxide emitted into the atmosphere by moving towards green energies. I’ve found a few web hosts (servers powered by recyclable energies) that offer green hosting services in a good price; listed below are my top three preferences.

id="right">class="alignright" src="http://www.webhostingsecretrevealed.com/images/2009/0728-2.jpg" alt="Green Geek Hosting" width="140" height="120" />

Green Hosting with Green Geeks

What makes Green Geeks environmentally friendly?

No joke, websites hosted with Green Geeks are 300% clean powered! What the hosting company does: Green Geeks purchased (and will purchase) wind energy credits (certified by href="http://b-e-f.org/">Bonneville Environmental Foundation) in order to compensate for the power pull from the grid,. To live up the name “Green Geeks”, the company actually does more than just replacing the power consumed – they replace, with wind power, 3 times the amount of energy used by their web servers (thus the number 300% clean powered). That’s the highest ‘Green’ factor I can found online.

Sounds unbelievable? You bet. I was skeptical in the beginning but after checking on a recent href="http://www.webhostingsecretrevealed.com/images/home/gg-cert.jpg" target="_blank">certification (thanks to Green Geeks staff T.J. Williams), I determined that the company just purchased over 2.3 million MW of clean, renewable energy in March 2009. With that, there’s no doubt Green Geeks is the ‘green-est’ hosting in the market.

class="meteor-icon" style="font-size:130% !important;">
class="icon-link" style="color:inherit !important;">
 href="http://www.webhostingsecretrevealed.net/go/greengeeks">Click here to visit Green Geek Hosting online.

id="right">class="alignright" src="http://www.webhostingsecretrevealed.com/images/home/hostgator.jpg" alt="Hostgator" width="140" height="120" />

Green Hosting with Hostgator

What makes Hostgator environmentally friendly?

All Hostgator servers are fully wind powered by purchasing certified href="http://www.3degreesinc.com/products/recs/">Renewable Energy Credits (REC). More over, these wind power credits are solely generated in their home state of Texas.

Hostgator offer

Hostgator offers various level of hosting plans ranging from dedicated to shared server hosting. Their BabyGator plan is the most popular, where users get shared hosting services with unlimited storage, data transfer, and addon domain capacity at .95/mo. I’ve been using Hostgator for years and you can have my words on their server reliability. Hostgator hosting has a strong uptime record and I’m always pleased with their customer supports.

class="meteor-icon" style="font-size:130% !important;">
class="icon-link" style="color:inherit !important;">
 href="http://www.webhostingsecretrevealed.net/go/hostgator">Click here to visit Hostgator Hosting online.

id="right">class="alignright" src="http://www.webhostingsecretrevealed.com/images/home/hostpapa.jpg" alt="Hostpapa Hosting" width="140" height="120" />

Green Hosting with Hostpapa

What makes Hostpapa environmentally friendly?

Hostpapa went green by purchasing 100% green renewable energy to power our data center, web servers, office computers, laptops and office space. These energy sources supply HostPapa’s entire equivalent energy consumption into the power-grid with certified 100% renewable green energy sources, such as wind and solar-powered energy.

Hostpapa offer

Hostpapa offer unlimited hosting in a very affordable price. For customers who signed up Hostpapa three years upfront, they’ll get unlimited storage, data transfer, and addon domain capacity plus a free domain name for life at the price of .95/mo. While the offer sounds great, I should however point out that they limit the usage of MySQL databases where users can’t go more than 100 databases for a single account.

class="meteor-icon" style="font-size:130% !important;">
class="icon-link" style="color:inherit !important;">
 href="http://www.webhostingsecretrevealed.net/go/hostpapa">Click here to visit Hostpapa Hosting online.

id="right">

The Best Green Hosting?

The reason I picked GreenGeeks as the Best Green Hosting is simple: They are the ‘Green-nest’ and their staffs are being very responsive (I learned this via my working experience with them). What impressed me the most is that they are not only neutralizing their environmental impact (server power and cooling), they’re reversing it. At this time of writing, GreenGeeks’ server are all 300% powered (certified by Bonneville Environmental Foundation)!

Wow 300%! How is that possible?

Well, here’s how: GreenGeeks replace, with wind power, 3 times the amount of energy used by their servers. So if their servers pull 1X of power from the grid; the company purchase enough wind energy credits to put back into the grid 3X of power having been produced by wind power. For reference, figure on your right is the certificate of purchase of 2.3 million MW of clean, renewable energy of GreenGeeks.

class="meteor-icon" style="font-size:130% !important;">
class="icon-link" style="color:inherit !important;">
 href="http://www.webhostingsecretrevealed.net/go/greengeeks">Check out GreenGeeks green hosting plans.


Page 28 – Web Hosting Secret Revealed