Download Print.css in a .zip file

Not knowing CSS very well and being new to WordPress, I looked all over for a Printer Friendly plugin that would print just the body of the pages in a post or a page on my website. I found a plugin, but I could not get it to work. (I am not experienced enough to know how to edit CSS and PHP very well) . I also found a couple of pre-made CSS files that were to make the posts and pages printer-friendly, but I did not have the right theme or know what they were trying to include, and so it would not print right for me.

In the end, I was able to find a basic CSS tutorial on how to make a printer-friendly CSS file. But, the tutorial was not really made for WordPress. So, back to the drawing board. In the end, I created a printer-friendly CSS file. I had to add a bit of code to the header.php page of the theme to get it to work correctly. This file will not give you an on screen printer preview of what it will print. But, if you goto File / Print Preview in the browser, it will show you what the page will look like before you print it.

This one file may not work for all, but I have included a short how-to to modify it. Basically, if it is showing things you do not want to print, then look in your theme / style.css (For WordPress)  file to see what the name of the ID is. For example, if it is showing the menu blocks on the right and left side of the page, and you do not want to print those, then look in the style.css file and find what they are called. For example, you might find this in your style.css:

#block {
padding: 0 0 0 0;
font-size: 80%;
text-align: justify;
}

So, in the print.css , replace

#right_block {
display: none;
}

with

#block {
display: none;
}

and it will make it so what is defined in the style.css as #block will not display when you print it. You can use this to narrow down the elements on the page you want to be printed.

Also, for WordPress, you need to add the following to your header.php file that is found in your theme folder.

<link rel=”stylesheet” type=”text/css” media=”print” href=”<?php echo get_settings(’siteurl’); ?>/print.css” />

If you are not using WordPress, you still need to put this in the head of the page(s) you want to be printer friendly.

To view it before it prints, open your browser, see if it has File | Printer Preview and click on it, view it and then you can print it.

Unfortunately, my knowledge on CSS and PHP is extremely limited so I will not be able to support this. The best thing I can say is play around with it and try new things. You can always delete the print.css if you get it all out of whack. It might take a few tries to get it just right for what you want to print.

Download Print.css in a .zip file

End of Article





22 Responses to “CSS Printer Friendly for WordPress”

  1. eveums (1 comments) Says:

    Thank you for writing this post and for the help on the WP forums! I’m looking forward to working with print.css.
    Best wishes!

  2. Aleeya (10 comments) Says:

    You are welcome. I hope it helps!

  3. Farhan (1 comments) Says:

    Very useful, thanks.

  4. My Little Yorkshire Terrier (1 comments) Says:

    Alles, das Sie wnschen, ist vor Ihnen recht. Die Frage ist “was Sie tun mit ihm”?

  5. affiliate internet marketing (1 comments) Says:

    Great blog. Found your blog while searching for more information at yahoo about this post . Your blog has quite a lot of interesting thoughts. Keep up the good work!

  6. Bobs Spas (1 comments) Says:

    You have really done a good job on this. Keep it up!

  7. lening (1 comments) Says:

    Hi, I like your site! I enjoyed browsing it. Thanks. In Dutch we say dank-je-wel 4 thanks)) :-)

  8. hypotheek (1 comments) Says:

    I like what you did with the design of your blog! Compliments. Regards, Albert.

  9. ibm disaster recovery (1 comments) Says:

    Stopping by! I am trying to start my own blog on disaster recovery site suggest.I heard some people just have blogs now and don’t use regular urls? Do you agree with this way to promote url?. Just starting out, DREW

  10. fax server topcall (1 comments) Says:

    I loved your post! I came across your blog and it really cuaght my attention, I’ll be sure to come back for more! Keep up the good work!

  11. Susan (1 comments) Says:

    Hi, My name is Suzanne from France. 16 years of age. I like this too! I am a student, doing research on the recent ‘bloghype’ I hope you do not mind me using it coming thursday when I have to finish my project. It would be nice to show my teachers I learned something here. Thanks. :-)

  12. limoserv963 (1 comments) Says:

    Hi, I thought I’d just leave this message on your blog. I hope you don’t mind. I’ve been trying to find blogs where people are talking about Search engine marketing tutorials and when I was looking, I found this one on this post. You have helped me in some way. Anyway, I want to say thank you before I go off to find some more info about it.

  13. Lawyer (1 comments) Says:

    I couldn’t agree more!

  14. GFFANull (1 comments) Says:

    I really could care less but I did agree with what you said.

  15. Ramon (1 comments) Says:

    Thanks for the information. Very helpful.

  16. Quincy (1 comments) Says:

    Awesome! Thanks.

  17. Grant (1 comments) Says:

    Awesome! Thanks.

  18. Corey (1 comments) Says:

    Wow this is a nice site. :0) I like the comments even though I don’t 100% agree with all of them. I am a grad student at the University of Sacred Heart in Connecticut. If you don’t mind I will use your blog as a example for my semester project that I am doing on the internet and ecommerce. If you reject the thought send me a quick email

    -Corey

  19. LEONARDO (1 comments) Says:

    What is up! I am trying to start my own blog on restore data excel.Can you add your blog as a subdirectory of your domain if you already paid for domain?. Thank you so much, LEONARDO

  20. Hotels Leeds (1 comments) Says:

    I use something called Programmers Notepad which is completely free to edit my css files.

  21. Artem (1 comments) Says:

    Thank you for writing this post!

  22. Yamaha Parts (1 comments) Says:

    Great post girl!

Leave a Reply

By submitting a comment here you grant this site a perpetual license to reproduce your words and name/web site in attribution.