• kwilson2

    (@kwilson2)


    Hi there,

    Love the theme, can’t seem to get it working with a child. I’m at https://www.tucsoncrystalandchinarepair.com/blog

    My best guess is that the parent stylesheet is being loaded after the child, or the child is being ignored completely.

    I’ve cleared the cache, used !important, and looked through the header and index files for some indication of why it would load the parent last, but to no avail.

    Here’s what my childtheme looks like:

    https://pastebin.com/fhqhWEx0

    Any suggestions?

Viewing 3 replies - 1 through 3 (of 3 total)
  • WPyogi

    (@wpyogi)

    You don’t currently have a child theme active on that site. Did you switch to it (i.e. activate it) once it was set up?

    Real basic question, but after uploading your child theme, did you activate it? (I’ve seen several folks forget that part!)

    Hi @kwilson2,

    PinBlue’s style is actually loaded using wp_enqueue_style() instead of hardcoding it directly to the theme header.

    So, to load your stylesheet after the parent stylesheet, add the following php code to your functions.php file:

    function pinblue_child_enqueue_style(){
    	wp_enqueue_style('pinblue_child_style', get_stylesheet_directory_uri() . '/style.css', array('pinblue_style'));
    }
    add_action('wp_enqueue_scripts', 'pinblue_child_enqueue_style');

    This will load your child theme’s stylesheet after the parent theme’s stylesheet.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Child theme stylesheet overridden’ is closed to new replies.