0

I have a color switcher but its css files load before default css files.so, it doesn't work good.I want to fire it after enqueue script.after all css and js files on the website, I want to load my color switcher css file.

it adds:

<link rel="stylesheet" id="colors" href=link.com/colors/color-2.css" type="text/css">

with some functions like that:

jQuery(document).ready(function($) {
    $("ul.colors .color1").click(function () {
        $("#colors").attr("href", "<?php echo esc_url ( plugin_dir_url( __FILE__ ) . '/css/colors/default.css'); ?>");
        return false;
    })
});

I want to add id="colors"after all css and js files.

1
  • "its css files load before default css files.so, it doesn't work good" - sounds like you need better targeted CSS selectors.
    – vancoder
    Sep 22, 2021 at 16:48

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.