Site logo

Archived topic

Child-Theme: print.css

7 replies · Started by Anonymous on September 20, 2015

Viewing posts 1–8 of 8

Hello Tom,

How can I load a print.css in my child theme?

I have tried the following code, but without success

<?php
/**
 * Generate child theme functions and definitions
 *
 * @package Generate
 */

function child_script() {
  wp_enqueue_style( 'print', get_template_directory_uri() . '/print.css', null, null, 'print' );
}
add_action( 'wp_enqueue_scripts', 'adamos_child_script' );

?>

I found my mistake ...

function child_script() {
  wp_enqueue_style( 'print', get_stylesheet_directory_uri() . '/print.css', null, null, 'print' );
}
add_action( 'wp_enqueue_scripts', 'child_script' );

But it does not work!

The above should work - can you confirm you have a print.css file in your child theme folder?

Yes , the file is located in the child-theme folder. But the changes are not shown...

Can you link me to your site?

It works for me now...!

Awesome :)

This archived topic is closed to new replies.