Closed aiiddqd closed 9 years ago
Did you include:
@import url("../unite/style.css");
or (if theme was taken directly from Github and folder names was not changed) in style.css?
@import url("../unite-master/style.css");
If this is not the case, please share your code you have used in style.css and maybe even website URL if it is on live website.
Codex recommends to not use @import
. The following code in child's functions.php
did work for me:
<?php
add_action( 'wp_enqueue_scripts', 'enqueue_child_theme_styles', PHP_INT_MAX);
function enqueue_child_theme_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );
}
@ooscarr
Your method is closer but still won't work for Unite theme because your solution makes Child Theme style.css to load BEFORE Parent Theme style.css. Which means that no custom CSS would be applied as Parent Theme style.css would be more dominant.
A better solution would be like this:
// Queue parent style followed by child/customized style
add_action( 'wp_enqueue_scripts', 'unite_enqueue_child_styles', PHP_INT_MAX);
function unite_enqueue_child_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
wp_dequeue_style('unite-style');
wp_enqueue_style( 'child-style',
get_stylesheet_directory_uri() . '/style.css',
array('parent-style')
);
}
Hi! I create child theme from insctruction http://codex.wordpress.org/Child_Themes But theme not worked and view as original Bootstrap.