Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1412157

    I noticed that in Enfold 5.5 my style.css from Enfold Child had priority over woocommerce css.
    After updating to 5.6 it’s the other way around.

    Can you help me with this?
    I want style.css to be prioritised

    Thank you!

    #1412351

    Hey Alex,
    Thank you for your patience, to move your child theme style.css to the top priority add this code to the end of your child theme functions.php file in Appearance ▸ Editor:

    add_action( 'wp_enqueue_scripts', 'av_dequeue_child_stylecss', 20 );
    function av_dequeue_child_stylecss() {
        if(is_child_theme()){
            wp_dequeue_style( 'avia-style' );
        }
    }
    add_action( 'wp_enqueue_scripts', 'av_reenqueue_child_stylecss', 9999999 );
    function av_reenqueue_child_stylecss() 
    {
        if (is_child_theme()){
            wp_enqueue_style( 'avia-style', get_stylesheet_uri(), true, filemtime( get_stylesheet_directory() . '/style.css' ), 'all');
        }
    }

    Please ensure to copy the code from the forum and not an email notification so the symbols are not converted.
    But please note that priority doesn’t override specifically, so if you are having trouble overriding some specific css please explain and like to the page so we can advise.

    Best regards,
    Mike

    #1412398

    Hey Mike,

    thank you very much.

    That helped.

    I wish you a nice day!

    #1412408

    wow – i never heard about that filemtime() Function – thanks nice to know

    #1412419

    Hi,
    alexgorg Glad we were able to help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.
    Guenni007 it was new for me too, I found it can also be used to register and enqueue styles and scripts in this article.

    Best regards,
    Mike

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘CSS Priority’ is closed to new replies.