[Resolved] Properly enqueueing a stylesheet

Home Forums Support [Resolved] Properly enqueueing a stylesheet

Home Forums Support Properly enqueueing a stylesheet

  • This topic has 3 replies, 2 voices, and was last updated 5 years ago by Tom.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #856303
    Daniel

    Hi Tom and team,

    I am using a child theme and scss as part of my development process and I am wanting to enqueue a css stylesheet compiled from my scss files on my child theme. I know that I need to put this in my child theme functions.php file but my knowledge stops there lol.

    What is the proper way of enqueueing it? Would you be able to provide me with the php snippet?

    Thank you,

    D

    #856342
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    You can do this:

    add_action( 'wp_enqueue_scripts', function() {
        $child_folder = trailingslashit( get_stylesheet_directory_uri() );
    
        wp_enqueue_style( 'your-style-id', $child_folder . 'your-filename.css' );
    } );

    Let me know if you need more info ๐Ÿ™‚

    #856347
    Daniel

    Thanks Tom.

    Always appreciate the amazing product and even better customer support!

    #856349
    Tom
    Lead Developer
    Lead Developer

    Glad I could help ๐Ÿ™‚

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