Rajan Chopra
Rajan Chopra

Reputation: 13

Bootstrap files get priority over my child theme style.css file

I am creating custom WordPress theme. I have a child theme and parent theme. One issue is my child theme function.php file not adding bootstrap files, So I called it in parent theme, but now the issue I am getting is bootstrap CSS taking priority over my child style.css.

I have tried this code in my child theme function.php file but its not working. Its not showing any custom.css in view source. I have both files in correct path

add_action('wp_enqueue_scripts', 'theme_enqueue_styles', 100);
function theme_enqueue_styles()
{   $parent_style = 'flambird-style';
    $child_style = array('flambird-style');
    wp_enqueue_style($parent_style, get_template_directory_uri() . '/bootstrap/custom.css', array());
    wp_enqueue_style('child-style', get_stylesheet_directory_uri() . '/css/custom.css', $child_style);
}

its not adding custom in both condition. I think my child theme function.php file is not working. Please help me on this. I want to use child theme css file.

enter image description here

Upvotes: 1

Views: 180

Answers (1)

okzoomer
okzoomer

Reputation: 336

Add !important to your css formats when there is a conflict, or host your own copy of Bootstrap with compatible changes.

Upvotes: 1

Related Questions