Wrong order of the stylesheets loaded - by Royalty

This topic has 2 replies, 2 voices, and was last updated 6 years, 10 months ago ago by Rose Tyler

  • Avatar: Royalty
    Royalty
    Participant
    June 9, 2017 at 09:55

    Hello,
    I am having problems with a plugin (Popup Maker) and the author tried to help me to solve it. He came across that the conflict is caused by the order the stylesheets are loaded. He said: “Typically themes should try to register their CSS as late as possible but that isn’t common. Your themes style.css file loads sooner than the popup maker CSS which is why you need !important.”
    I’ve added a screenshot in private content to see in which order the stylesheets are loaded (active plugins are only Popup Maker and Woocommerce).
    Any help on how to order the stylesheets in the right way would be really appreciated.
    Many thanks in advance.

    Please, contact administrator
    for this information.
    1 Answer
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    June 9, 2017 at 14:34

    Hello,

    You can add this code in function.php file of your child theme:

    remove_action( 'wp_enqueue_scripts', 'etheme_enqueue_styles', 130);
    add_action( 'wp_enqueue_scripts', 'etheme_enqueue_styles',  20);

    and try to change 20 value to change order.
    But we don’t recommend change order of the stylesheets loaded because you may have some conflict of styles with other plugins.

    Regards,
    Rose Tyler.

  • Viewing 2 results - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.