Include print style sheet

How do I properly link a print style sheet?
All my styles have been enqueued through functions file.

The codex suggested I put the link in the header but this didn’t work, is there a core print stylesheet?

Read More

I tried to create a link in the header but I see any of these styles?
I do see the print.css file in the header when I look at the source.

/css/print.css” type=”text/css” media=”print” />

Related posts

1 comment

  1. Use wp_enqueue_style to add a print stylesheet, note the media parameter that lets you make it a print-specific stylesheet:

    function wpa_print_styles(){
        wp_enqueue_style(
            'wpa-print-style', 
            get_stylesheet_directory_uri() . '/print-style.css', 
            array(), 
            '20130821', 
            'print' // print styles only
        );
    }
    add_action( 'wp_enqueue_scripts', 'wpa_print_styles' );
    

Comments are closed.