• l r

    (@lainyrache)


    Hello

    I am using a child theme of TwentyTwenty. I would like to override the print.css with my own. I have added a print.css to my child theme folder, but the link in my header is still pointing to the parent theme.

    Can anyone point me to a function I can use to override this?

    thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Did you try enqueuing it?

    Thread Starter l r

    (@lainyrache)

    Hi Michael

    I found the following on the forum:

    // Queue parent style followed by child/customized style
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles', PHP_INT_MAX);
    
    function theme_enqueue_styles() {
        wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/print.css' );
        wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/print.css', array( 'parent-style' ) );
    }

    This does not work at all. The parent print.css is still being called.

    Also, this looks to me like it is trying to call the parent stylesheet and then the child one. What I would like to do is dequeue the parent stylesheet and then call the child one only.
    I can’t find any sample code for this, and my PHP skills aren’t up to the challenge.
    Thanks for your help!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Child theme print.css’ is closed to new replies.