New Landing How can we help? Atelier Link external stylesheets

Viewing 4 posts - 1 through 4 (of 4 total)
  • Posted in: Atelier
  • #212547
    Nhaugaard
    Member
    Post count: 164

    Hi guys.
    I’m doing a lot of customizations to the theme, and plugins. And i’m currently using the ‘Custom Css’ tab in theme settings. But i was wondering, since i have so much code in there by now. If it is possible to create separate stylesheets and place them in my root directory, and then somehow link them into the custom css section? I’m not really sure how to approach this, and was hoping you might have some advise for me.

    All the best,
    Nikolaj.

    #212557
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please use child theme https://codex.wordpress.org/Child_Themes. You can insert all code at style.css of child theme. And insert code at functions.php file of child theme.

    
    function theme_enqueue_styles() {
    
        $parent_style = 'parent-style';
    
        wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
        wp_enqueue_style( 'child-style',
            get_stylesheet_directory_uri() . '/style.css',
            array( $parent_style )
        );
    }
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );

    Thanks
    Mohammad

    #212563
    Nhaugaard
    Member
    Post count: 164

    Thanks Mohammad. I’ll check it our 🙂

    Thank you!

    #212568
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Check it and let me know your feedback.
    Thanks
    Mohammad

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register