skip to Main Content

I want on the WP page with ctrl+p print only some classes and not the whole page. So can I do it?

2

Answers


  1. -Clicking the Print button on the toolbar instantly prints the web page. To work the Print dialog box, choose Print from the Print button’s menu or press Ctrl+P.

    -A single web page is often output to several printed pages.

    -To print only part of a web page, select the part you want by using the mouse. Then press Ctrl+P and, in the Print dialog box, choose Selection. Click the Print button to print only the selected portion of the web page.

    -Only one part of a web page can be selected at a time.

    -Sometimes, text fails to show up when you select the Shrink to Fit option. It’s a “feature” of the web page. Simply choose another size from the Change Print Size menu.

    -You can print an image on a web page by right-clicking the image and choosing Print Picture from the shortcut menu. This trick comes in handy when the image doesn’t print with the rest of the web page.

    Login or Signup to reply.
  2. I am unsure how free you are with WordPress, but, if you are able to implement your own CSS (since you used it as a tag), you can use a media query to exclude/include classes when the user prints the page. @media print targets the print style of the page.

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>test.html</title>
        <link rel="stylesheet" href="test.css" />
    </head>
    <body>
        <p class="c1">class 1</p>
        <p class="c2">class 2</p>
        <p class="c3">class 3</p>
    </body>
    </html>
    
    @media print {
        .c2 {
            display: none;
        }
    }
    

    Web View:

    web page saying class 1, 2, and 3 on 3 separate lines

    Print View:

    web page saying class 1 and 3 on 2 separate lines

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search