• I cannot have a child theme with css thet works…
    i must add !important to any rule…
    Why? that’s a specific method for Sullivan child theme?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Theme Author Anders Norén

    (@anlino)

    Hi @lucbord,

    Can you post the code you use in functions.php to enqueue the Sullivan files in your child theme?

    — Anders

    Thread Starter Lucbord

    (@lucbord)

    hi Anders…

    certainly

    <?php

    add_action( ‘wp_enqueue_scripts’, ‘enqueue_parent_theme_style’ );
    function enqueue_parent_theme_style() {
    wp_enqueue_style( ‘parent-style’, get_template_directory_uri().’/style.css’ );
    }

    thnks for support

    Theme Author Anders Norén

    (@anlino)

    Hi @lucbord,

    Sullivan includes more stylesheets than just the style.css file, so while your code would enqueue the main stylesheet correctly, it won’t enqueue the other stylesheets in the theme.

    The easiest solution would be to enqueue your child styles with a lower priority so it gets loaded after the parent theme styles. That way, your child theme styles will overwrite the parent theme styles without !important. Like so:

    function sullivan_child_styles() {
    	wp_enqueue_style( 'child-style', get_stylesheet_uri() );
    }
    add_action( 'wp_enqueue_scripts', 'sullivan_child_styles', 15 );

    — Anders

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