Childtheme not taking css from parent

Hello!

I started to build new site with unite and then created childtheme for that. I did not add any new css. En parent theme nor in childtheme yet Everything shall be like in initial parent theme by default. But it`s not, for example menu text is grey and slider text is messy and not aligned to the left as in original theme and demo, there is no purple background in the menu etc… Childtheme is created like in wordpress codex. Css file:
/*
Theme Name: newtemplate
Template: unite
Text Domain: newtemplate
*/

functions.php file:
<?php
function 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 )
);

}
add_action( ‘wp_enqueue_scripts’, ‘theme_enqueue_styles’ );
?>

What shall I do to get those unite default settings to childtheme as well? Sure I can change css but as I don`t want to do major changes, would be great to be able start from default ones.
Thanks!

Hi @sandras,

Thank you for your question.

You can try achieving this by using the attached custom child theme of Unite theme that contains following code which is working fine on my site.

style.css File :

/*
Theme Name: Child Theme
Template: unite
Author: Free WP TP
Author URI: http://freewptp.com/
*/

functions.php File :

<?php

// Queue parent style followed by child/customized style
add_action( 'wp_enqueue_scripts', 'func_enqueue_child_styles', 99);

function func_enqueue_child_styles() {
    wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
    wp_dequeue_style('unite-style');
    wp_enqueue_style( 'unite-style',
        get_stylesheet_directory_uri() . '/style.css',
        array('parent-style')
    );
}

Best Regards,
Movin

Thank you so much! That made the thing!!

You are most welcome here :slight_smile: