• I use the code for connection child css from the codex

    <?php
    add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
    function my_theme_enqueue_styles() {
     
        $parent_style = 'parent-style'; // This is 'twentyfifteen-style' for the Twenty Fifteen theme.
     
        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 ),
            wp_get_theme()->get('Version')
        );
    }

    But css loading twice
    <link rel='stylesheet' id='child-style-css' href='https://example.com/wp-content/themes/child-theme/style.css?ver=0.1.1' type='text/css' media='all' />
    and
    <link rel='stylesheet' id='twentythirteen-style-css' href='https://example.com/wp-content/themes/child-theme/style.css?ver=2013-07-18' type='text/css' media='all' />
    How can I fix it?

  • The topic ‘Double css in child theme’ is closed to new replies.