• Hi, I have to solve similar problem..
    After installing the theme, to edit it with the Child theme I did not consider to add anymore on style.css usuall @import but i added on functions.php the function:

    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
    function theme_enqueue_styles() {
        wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
    
    }

    but nothing, just corrupt theme on WP control panel..
    Then i discovered i wrote on style.css file, Template: Tracks instead of Template: tracks with lowercase t , and no more corrupt theme.
    I activeted the child theme and.. 500 internal server error!!
    Anyway, now i fixed this problem reinstalling after deleting tabels on mySql.
    That is final, the function on functions.php, do i have to change something or this is the code??
    And if i have another css called style.min.css , what i have to do??
    Thanks!!

Viewing 1 replies (of 1 total)
  • You can add multiple css files using same method.
    See example below

    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
    function theme_enqueue_styles() {
        wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
    
     wp_enqueue_style( 'mystyle2-style', get_template_directory_uri() . '/mystyle2.css' );
    
     wp_enqueue_style( 'mystyle3-style', get_stylesheet_directory_uri() . '/childthemestyle.css' );
    
    }
Viewing 1 replies (of 1 total)
  • The topic ‘add_action on functions.php and 2 css files’ is closed to new replies.