This topic contains 2 reply and 2 voices, and was last updated by Paul 5 years, 7 months ago
Viewing 2 Posts - 1 through 2 (of 2 total)
Author Posts
April 7, 2014 at 10:08 pm 18194
Paul 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
April 7, 2014 at 11:58 pm 18206
Tareq Hasan Tareq Hasan

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]

April 8, 2014 at 3:41 pm 18262
Paul Paul

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 2 Posts - 1 through 2 (of 2 total)