• I’m using the TwentyTwenty theme as the parent theme for a site I’m working on. I’ve used

    add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
    function my_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 ),
            wp_get_theme()->get('Version')
        );
    }

    from the WP handbook for child themes but it’s loading the stylesheets wrong.
    Here is what I see when I view the source file

    <link rel='stylesheet' id='child-style-css'  href='https://hifu.wpengine.com/wp-content/themes/hifu/style.css?ver=1.0.0' media='all' />
    <link rel='stylesheet' id='twentytwenty-style-css'  href='https://hifu.wpengine.com/wp-content/themes/hifu/style.css?ver=1.0.0' media='all' />

    I’m not sure what is going on I’ve never run into this before.

    This is in my child theme css

    /*
    Theme Name: HIFU Theme
    Theme URI: https://webdonewell.com
    Author: Webdonewell
    Description: HIFU Training Theme
    Template: twentytwenty
    Version: 1.0.0
    */

    I really need to get this resolved. I’m sure I’m just missing something simple.

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Twenty Twenty Child theme Loading parent theme last’ is closed to new replies.