[Resolved] Child-Theme: print.css

Home Forums Support [Resolved] Child-Theme: print.css

Home Forums Support Child-Theme: print.css

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #138331
    Andreas

    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' );
    
    ?>
    #138332
    Andreas

    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' );
    #138334
    Andreas

    But it does not work!

    #138376
    Tom
    Lead Developer
    Lead Developer

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

    #138419
    Andreas

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

    #138513
    Tom
    Lead Developer
    Lead Developer

    Can you link me to your site?

    #138705
    Andreas

    It works for me now…!

    #138789
    Tom
    Lead Developer
    Lead Developer

    Awesome 🙂

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.