• Hi xnau,
    I want to print labels from the records, but the styles I defined in own css / printing styles are ignored. Result is the same as on computer monitor. But on labels I don’t need page header an title.
    Is it possible to use different styles for printing? How?

    Thank you

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Roland Barker

    (@xnau)

    In the plugin settings, under the “Custom CSS” tab, there is a space for print sheet rules.

    Thread Starter oekoplatt

    (@oekoplatt)

    Sorry, but obviously my re-translation of “Custom CSS” into “own css” was wrong.
    But:
    My css-rules in “Custom CSS” / “space for print sheet rules” are not executed. When I put in in my custom template (adapted from https://xnau.com/using-the-pdb_template-helper-class-in-a-custom-list-template/) after

    <?php // this is an example of a way to style the records, delete this or edit as needed ?>
    <style type="text/css">
      section {
        margin: 1em 0;
      }
    

    they are executed…
    The rules are:

    @media print {
    h1, 
    h2, 
    h3, 
    h4, 
    h5,
    .site-header,
    .widget_template_part,
    .template-part-site-branding,
    .template-part-main-nav,
    .entry-header,
    .page-header,
    .entry-title,
    .page-title,
    .print-link {
        display:none !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
        line-height: 0pt !important;
        white-space: nowrap;
    } 
    }

    What is the explanation?
    Thank you

    Plugin Author Roland Barker

    (@xnau)

    Those CSS rules are probably added by your WP theme. In the HTML inspector, it will tell you the source of the CSS rules.

    Thread Starter oekoplatt

    (@oekoplatt)

    It’s the same situation with the themes Twenty8teen and Twenty Sixteen… Both themes have media query (@media print {…}) in their style.css. The rules work in the custom template but not in the Custom CSS of the plugin.

    Plugin Author Roland Barker

    (@xnau)

    If the theme is adding CSS rules that you don’t want, you need to add CSS that overrides them in the custom CSS.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘print.css’ is closed to new replies.