How to link option to print from website (3 posts)

  1. DADurocher
    Posted 6 years ago #

    I have an order form that I would like viewers to be able to print from our website. How can I make this happen?

  2. vtxyzzy
    Posted 6 years ago #

    See the Codex on Styling for Print.

    Basically, the easiest way is to provide a special stylesheet for printing and load that in your header. Then the user can use the 'Prt Scr' key to print the form.

    Here is what my print.css file is like (yours will probably be similar, but not exactly the same depending on your theme):

    @media print {
    body {background:white;
         margin:0 }
    #header { display: none }
    #wpmenu1 { display: none }
    #content{ margin-left:0;
         width:auto }
    #content a { font-weight:bold;
         text-decoration:underline }
    .pagelinks { display: none }
    #right-column { display: none }
    #footer, .ad { display:none }
    h1, h2, h3, h4, h5, h6 { page-break-after:avoid;
         page-break-inside:avoid }
    h3 { margin-left:10px;
         padding-bottom:0px }
    h5 { font-weight: bold;
         font-size: 12pt;
         margin-top: 1em;
         margin-bottom: 0.2em; }
    blockquote, table, pre { page-break-inside:avoid }
    ul, ol, dl  { page-break-before:avoid }
    .right { float: right; }
    .left { float: left }
    img { display: none; }
  3. sacredpractice
    Posted 5 years ago #

    this is great, could someone explain how to add a "PRINT" link on the page so it pops up a print preview page?

    thnx in advance.

Topic Closed

This topic has been closed to new replies.

About this Topic