• Resolved benjgold

    (@benjgold)


    I’ve tried to follow your advice regarding creating a child theme for easier customization of the css. However, I am having problems getting my custom style.css to override the parent style.css file. I’ve set up child themes before without difficulty. I’ve double-checked to insure that my set up is correct. I’m not sure why this isn’t working. The only thing I can thing of is that I am not importing the correct css file. Right now I am calling ‘style.css’ from the main theme folder. I’ve tried using the old @import method, and the current best practice of using enqueue in a functions.php file within the child theme. Can you suggest anything that might help?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter benjgold

    (@benjgold)

    On closer inspection, I see that the parent is mostly using styles from sytle.min.css. I listed this as the dependency in my functions.php file. Should I be listing any other css files as well?

    Still, the parent styles are overriding my child styles. When I call ‘!important’ on the child style, then it overrides the parent. Of course, I don’t want to do that for all of my css.

    Thread Starter benjgold

    (@benjgold)

    Included other stylesheet dependencies in my child functions page (‘style.css’, ‘css/style.css’, ‘css/style.min.css’). Still, child styles are being overwritten by style.min.css.

    Theme Author monkey-themes

    (@monkey-themes)

    Hi,
    load a custom stylesheet after the style.min.css

    function ods_child_scripts()
    {
        wp_enqueue_style( 'custom-style', get_stylesheet_directory_uri() . '/custom-style.css' );
    }
    add_action( 'wp_enqueue_scripts', 'ods_child_scripts', 20 );
    Thread Starter benjgold

    (@benjgold)

    Worked like a charm. Thank you very much for the quick response!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Child Theme Issues’ is closed to new replies.