Support » Fixing WordPress » @Media Print not recognized

  • Sherry

    (@dreamer0201)


    I have a custom child theme (Twenty Thirteen) that I designed for a client. I cannot get the print code in the style sheet to be recognized.

    View All Jobs

    Any suggestions? I’ve tried everything I can think of. I have a plugin installed to print this one page, but I want my code to work for all pages.

    Sherry

Viewing 11 replies - 1 through 11 (of 11 total)
  • esmi

    (@esmi)

    Forum Moderator

    Have you validated the stylesheet?

    Sherry

    (@dreamer0201)

    How do you do that? I’ve been doing WordPress for many years and have not heard this. hmmm

    esmi

    (@esmi)

    Forum Moderator

    You have never validated your markup or your stylesheets?! It’s nothing that is specific to WordPress. It’s just good development practice generally. See Validating_a_Website.

    Sherry

    (@dreamer0201)

    I used to when I did static sites, but since I moved to WP, no I have not. I will look into it and see if there is something that is stopping the print from working.

    Sherry

    (@dreamer0201)

    I did a few pages and it’s all checking valid now. There was a couple tag errors on the home page, but nothing that would stop the @media print from being recognized. Any other suggestions?

    esmi

    (@esmi)

    Forum Moderator

    What happens if you turn it into a standalone print.css file?

    Sherry

    (@dreamer0201)

    the pages are completely blank.

    esmi

    (@esmi)

    Forum Moderator

    Sorry? What pages?

    Sherry

    (@dreamer0201)

    When I modified the header.php to link to separate print.css stylesheet all the pages came out blank for printing. The website was fine, but there was zip nadda nothing on the pages that showed up. Now, when I did that, I did not go in and set all the styles up for content, I just used the media print that was in the style sheet.

    Since the code I have now is not being recognized in the style.css, setting up all the code for .entry-content and sidebars, etc. would have to be done if I used separate print.css. Is that right? I did not set those up, just what I wanted modified for print.

    I just don’t understand why I’m having to go backwards and do it the way we used to. Why won’t the @media print work in the one style.css?

    My client is insisting on having the print work. I just have not had to worry about printing a web page in a long time.

    Sherry

    esmi

    (@esmi)

    Forum Moderator

    I just don’t understand why I’m having to go backwards and do it the way we used to.

    The idea is to slowly isolate the problem – hence moving the print CSS into its own sheet for the purposes of troubleshooting. But you do actually need some CSS in the print stylesheet. Preferably everything you previously had under @media print.

    Incidentally, all @media print does is allow to you load print CSS without making another http call.

    Sherry

    (@dreamer0201)

    Good points. I will re-set up the separate print.css to see if I can isolate.

    Thank you!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘@Media Print not recognized’ is closed to new replies.