• Resolved chrishe

    (@chrishe)


    Trying di-blog theme with a view to using it in my next project… Created a child theme, but child style.css always loading before the di-blog styles.
    Using WordPress 4.9.4, di-blog theme
    Please can you post the correct way to make a child theme with di-blog so that child style.css loads AFTER themes/di-blog/assets/css/style.css?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Theme Author Di Themes

    (@dithemes)

    Hi @chrishe

    You need to add dependency so functions.php code will be :

    function di_blog_child_enqueue_style() {
    	// Load main css file of parent theme.
        wp_enqueue_style( 'di-blog-style-default', get_template_directory_uri() . '/style.css' );
    
        // Load this child theme css after all parent css files.
        wp_enqueue_style( 'di-blog-child-style',  get_stylesheet_directory_uri() . '/style.css', array( 'bootstrap', 'font-awesome', 'di-blog-style-default', 'di-blog-style-core' ), wp_get_theme()->get('Version'), 'all' );
    }
    add_action( 'wp_enqueue_scripts', 'di_blog_child_enqueue_style' );

    Thanks

    Thread Starter chrishe

    (@chrishe)

    Good job! Thanks ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Problem making child theme’ is closed to new replies.