marko krstić

Collections

Archives

Register Print CSS

after the file path add array, version and then print

<php
wp_enqueue_style( 'print_css', plugin_dir_url( __FILE__ ) . 'assets/css/print.css', array(), '1.0.0', 'print' );

An entire block stored in function.php should look like this.

You can always add it as @media print but with this you will have much more flexibility and load it where you need it.

<php
// Styles
function theme_styles() {
    wp_enqueue_style( 'print_css', plugin_dir_url( __FILE__ ) . 'assets/css/print.css', array(), '1.0.0', 'print' );
}

add_action( 'wp_enqueue_scripts', 'theme_styles',  1000, 1 ) ;

More about Print CSS:

https://www.sitepoint.com/css-printer-friendly-pages/

https://www.smashingmagazine.com/2018/05/print-stylesheets-in-2018/

Let's Connect

Feel free to reach out for collaborations or just a friendly hello ?
[email protected]
linkedininstagramdribbblefacebook-official