Blogging doesn’t end at the monitor.
Many readers print out interesting posts, but not if your website prints with text off the page, adverts and other useless content. Adding a print stylesheet to your blog is an easy method of ensuring that your content remains useful on paper.
Do you blog about phone reviews? It’s perfectly plausible that your readers will print out a few of their favourites and take them down to the shop with them. Life advice? A reader could print out your words, to read later on at their leisure. Almost every niche has a reason to be printed.
Setting Up the Stylesheet
- Create a new file in your text editor (e.g. Notepad), and save it as print.css
- Upload this file to your theme’s directory. (The same place where your main stylesheet is)
- Open your theme’s header.php, and beneath the following line:
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
Add:
<link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/print.css" type="text/css" media="print" />
How Do The Styles Work
The essential purpose of the print stylesheet is to remove content. To do this, look through your page’s source code for sections that can be removed. You then give all of these sections a rule which tells the printer not to show them.
For example, if I wanted to remove my whole sidebar, I would look at the page source, and discover that it is all held within a div that looks like this:
<div id="sidebar">
##Sidebar Content Here##
</div>
I now add the following rule to my print.css, and the sidebar will not be shown:
#sidebar {display:none;}
NB – Had the code said <div class=”sidebar”>, the markup would beging with .sidebar, not #sidebar.
What Should Be Removed?
In short, everything that isn’t either content or the title. In most blogs, that means that the following usually need to be removed:
- Sidebars – The links, popular posts etc. in a sidebar are meaningless on a printed page.
- Advertisements – You aren’t going to make any money from print-outs, so why annoy the reader?
- Comment Forms – They can’t use them, so why waste space?
- Footers – The title and URL of the page are printed on the top of every page, and your content is copyrighted without the notice needing to be printed. There is no need to add on your “Powered by…” notices and such.
- Navigation, search bars or anything else you may have in the page’s header which isn’t related to the content.
Use the “Print Preview,” function in your browser to see the effect your changes are having, and continue taking away until the content is all that remains. As an example, you can see Pro Blog Design’s print stylesheet here.
Is your blog printer-friendly? Share your stylesheet with us.
Custom Search
Matthew Blancarte (4 comments)9 August 07
Awesome tip! I am still relatively new to css, so this was a great find. Thanks.
Michael Martin (1286 comments)9 August 07
Hey Matthew – Glad I could help you out. We all have to start off at the start with CSS. Every tip helps.
If you need some help sorting out a print stylesheet for your blog, just let me know.
Tyler Michael Jonsson (13 comments)14 August 07
Michael– Once again every post you’ve put up so far is something that I have chosen to look into implementing.
I will attempt this with my blog, and see how it goes in the coming days!
Good work again!
Michael Martin (1286 comments)14 August 07
Thanks a lot Tyler. Looks like things went well for you with this. Just one bug to sort out.
John Pickering (1 comments)4 February 08
That’s great advice – I’ve recently setup a wordpress blog and will try to apply these changes.Thanks for the great post
John
Michael Martin (1286 comments)4 February 08
You’re welcome. I’m glad you found it useful.
Laser Toners (1 comments)26 July 09
Awesome post! a must for all wp designers!
Mikko (5 comments)21 April 08
Cool tip.
I’ve seen a number of printed pages of my blog at home. My mom loves to print my own and my sister’s blog. Amf.
Brad (9 comments)27 May 08
I need some help. I have had the most difficult time finding a printer that can print greeting card envelopes. I’m talking about cheap Office Depot type greeting card envelopes (half fold and 1/4 fold paper for the envelopes). I have a brother MFC-5860CN and I can’t tell you the number of envelopes I have ruined trying to get the damn envelopes to print. If they don’t get jammed in my brother printer I get blotches of ink all over the front of the envelope as well as the print comes out crooked. I had an Epson Stylus C82 printer that worked perfectly and late last year it died so now I’m living in hell. I’m looking for a cheap printer so I can print envelopes and I don’t know which one to even look at. I contacted Brother and advised them of my problem printing greeting card envelopes and the lady told me, “that’s because your printer only prints #10 envelopes. Read your manual.” With that attitude I will never buy another Brother product. I went looking for help and got sarcasm. I figured I could print on any envelope, within reason of course. Any help would be greatly appreciated.
Thanks, Brad
Eddie (1 comments)29 July 08
Great tip thanks. Working with stylesheets/CSS is not one of my favourite past times so these kind of tips are most welcome.
Thanks again.
Adam (18 comments)11 December 08
Great tip, CSS can be exteamly helpful trying to format the paper to get the printer to print correctly to the page. I found that I was printing so many blogs, that I was running out of the ink cartridges for my printer!
Amit Banerjee (2 comments)23 February 09
Thanks man ! Very Helpful and detailed Post .
If you could Explain How can we add Extra parametrsIn Our Print Stylesheet that would be highly Appreciated ! (Like If i want to add a Black and White logo only in the Print stylesheet )
Selene (1 comments)19 March 09
Hi Michael,
Many Thanks for the tip.
I’m quite new to CSS so I try not to screw up the code.
Printer Ink Specialist (1 comments)4 April 09
If you look at the source code for my site (for example)…not being a spammer honestly, you will see 4 css page styles.
This is a good lesson how the style sheets function as Michael suggests above.
Thanks,
Jimi P.
PS by the way your AJAx edit function on the posts is great!!
RadioHead (1 comments)1 May 09
This is awesome. Thanks for posting this Michael. This will definitely help me out with my CSS for my site.
Michael Martin (1286 comments)5 May 09
Welcome, let me know if you have any trouble with it! It doesn’t take too long to do really, hope it goes well!
Diego R (1 comments)21 June 09
Thanks for the advice. Applied it to my site within 5 minutes.
Toner cartridges (1 comments)30 July 09
Every piece of data necessary to succeed, from basic tools and commands to vocabulary and layout creation, is packed into the nice post.
printer cartridge supplies (2 comments)23 August 09
I look forward in implementing your post. Cool tip Michael!
I will try to manage it with my blogs, and see how it goes in the coming days!
Nice job!
laser toner (1 comments)22 September 09
It’s perfectly plausible that your readers will print out a few of their favorites and take them down to the shop with them. Life advice..? A reader could print out your words, to read later on at their leisure. Almost every niche has a reason to be printed.
Printers (2 comments)12 November 09
Any suggestions on what kind of content we might want to add to the stylesheet?
Printer Experts (1 comments)13 November 09
If you need ink for you printer when printing those blogs, visit the Printer Experts and order your new cartridge online. Saves time and compatibles save money.
Lio@Cheap Printer Cartridges (1 comments)25 November 09
Tutorials, tips, they’re mostly to be printed out. Great thing to learn, although I doubt it if several bloggers would adapt to this.
printers (2 comments)25 November 09
Blogging is just not writing and restricting at monitor. Many readers, visitors often take print outs of any interesting information or article which they find on the web. But the owner or the blogger should ensure that the content of the blog remain useful on the paper as well.
Free Rrinter Facebook layout (1 comments)4 December 09
TheDocBlog has recently added some simple hidden features. When you print one of my articles, all the graphics, sponsor buttons, comment forms, and so on are turned off. Saving you some paper and the world some trees. More importantly it puts the article in a printer friendly format by removing the extra fat and making it easier to read.
shower (4 comments)9 December 09
the article let me realize that I need this kind of css, if somebody want to print my page he will find ugly page
Sigurfreyr (2 comments)1 January 10
Very helpful as to expected from your site!
Sigurfreyr (2 comments)1 January 10
Just wondering why my avatar image did not turn up last time?
Janiliewa (2 comments)15 January 10
Very useful tips.Thanks for the great post!
janiliewa (2 comments)15 January 10
Very useful tips.Surely will visit this blog again later,thanks.
Hua Chen (7 comments)31 January 10
I want to add a css style for print, but I don’t want to have a extra http request when viewing on pc. What can I do? Thank, you! Can you help?