1

I know this question has been asked many times. I even spent the entire day yesterday getting things to work but to no avail. I am pretty sure I am missing out on something small//silly but I am unable to figure it out.

So, here is my question: I have purchased the Identity-vcard theme from Envato and I want to make some modifications to the child theme without disturbing the parent theme. But the style.css of the child theme is not loading/overriding the parent’s. I am using this in the functions.php

function my_theme_enqueue_styles() {
    $parent_style = ‘Identity-vcard-style’;

    wp_enqueue_style( $parent_style, get_template_directory_uri() . ‘/style.css’ );
    wp_enqueue_style( ‘Identity-vcard-child-style’, get_stylesheet_uri() . ‘/style.css’, array( $parent_style ) );
}
add_action( ‘wp_enqueue_scripts’, ‘my_theme_enqueue_styles’ );

Can you please help me with this?

Thanks!

3

You are using get_stylesheet_uri() which links directly to your stylesheet, then your adding /style.css which is resulting in an invalid url.

So you need to remove the /style.css.

Or use get_stylesheet_directory_uri() and leave the /style.css on there.

0

Make sure you use get_stylesheet_directory_uri() in child theme and make sure that the parent theme is using get_template_directory_uri().

If the parent theme is not using get_template_directory_uri() you'll have to unregister the main style and register it again in your child theme.

Cheers!

  • Thank you. That worked. Registering and then queuing. Plus I had to register all the stylesheets since the theme uses more than one. Worked! – newbie1985 Jul 26 '16 at 9:49
  • Cool, can you give me an up and select my answer as correct, please? – user3498047 Jul 28 '16 at 13:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.