• I would like to add two CSS stylesheets to my theme. As of now, in my functions.php file, it only links to the style.css sheet of the parent theme. I can add my own CSS into the Additional CSS section on the main Customize section, but I would like to instead have the CSS styling coming from two external stylesheets, one with Bootstrap styles, and another with my own custom CSS. How can I do this? What is the code that I need to include in my functions.php file? I currently have this code:

    <?php

    add_action( ‘wp_enqueue_scripts’, ‘enqueue_parent_styles’ );

    function enqueue_parent_styles() {
    wp_enqueue_style( ‘parent-style’, get_template_directory_uri().’/style.css’ );
    }

    What do you recommend I change/add in order to add two additional stylesheets? Let’s say that additional stylesheet 1 is called “bootstrap.css”, and additional stylesheet 2 is called “mystyles.css”.

    Thank you in advance!

Viewing 1 replies (of 1 total)
  • Hello cher443,

    You can try below code for this

    function enqueue_parent_styles()  
    { 
    
    	wp_enqueue_style( 'main', get_template_directory_uri() . '/bootstrap.css' );
    	wp_enqueue_style( 'custom', get_template_directory_uri() . '/mystyles.css' );
    
    }
    add_action('wp_enqueue_scripts', 'enqueue_parent_styles');

    Hope this will helps you.

    Thanks.

Viewing 1 replies (of 1 total)

The topic ‘Adding several CSS stylesheets to Spacious-Child theme’ is closed to new replies.