Print CSS for body only

  • cleevewebby

    #9848

    Is there an easy way to set up some CSS in the print configuration so only the body of a page is printed?

    ie. no widgets header footer etc

    Mod

    Kenneth John Odle

    #44732

    You can override the theme’s print.css file in a child theme, either by including some specific print information in the style sheet:

    @media print{

    #header {display: none;}

    }

    or by enqueuing your own print stylesheet in your child theme’s functions.php file.

    cleevewebby

    #44733

    Hi Kenneth. I meant where it says under ‘General > Print Options>Enable print CSS for single posts and pages?

    I ticked the box but where is the print CSS ?

    Mod

    Kenneth John Odle

    #44734

    It’s a separate file included with the theme. There aren’t any print.css options bundled with the theme, so if you want to make changes, you’ll need to use one of the methods I’ve outlined above.

    FYI, it helps to take a look at the theme’s print.css file first.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.