Home Forums Theme Support Dokan Child theme?

This topic is: resolved

Tagged: ,

This topic contains 2 replies, has 2 voices, and was last updated by  Paul 5 years, 3 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #18194

    Paul
    Member
    Post count: 118

    Hi,
    I've added a child theme to Dokan but none of the changes are overwriting the original CSS – not even with !important, is there something additional I need to do?

    Thanks

    #18206

    Tareq Hasan
    Keymaster
    Post count: 2831

    I haven't tested yet creating a child theme, so such issues might arise a lot ๐Ÿ™‚

    For this exact problem, may be you should enqueue your stylesheet by giving a bigger priority so that it'll load after the main stylesheet has been loaded. Like this:

    [php]
    function theme_name_scripts() {
    wp_enqueue_style( ‘style-name', get_stylesheet_uri() );
    }

    add_action( ‘wp_enqueue_scripts', ‘theme_name_scripts', 99 );
    [/php]

    #18262

    Paul
    Member
    Post count: 118

    Hi Tareq,

    Ah thanks, I've created a functions.php file in my child theme and included:

    <?php
    
    function theme_name_scripts() {
        wp_enqueue_style( 'style-name', get_stylesheet_uri() );
    }
     
    add_action( 'wp_enqueue_scripts', 'theme_name_scripts', 99 );
    
    ?>

    That seems to have sorted it, although improved child theme compatibility would be great (for storing customizations, so they aren't affected by theme updates).

    Thanks!

    Brad

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Child theme?’ is closed to new replies.