1

I need help with a small issue.

I want the child theme style.css file to be loaded from scratch since I'm doing heavy graphic modification and no all the changes are properly loaded.

I know this can be done using the style.css?ver=XXXX.

I see that my website is now loading the version 5.3 that I imagine being the wordpress version running on the website atm.

What files (where and how) do I need to change to solve this problem?

Thanks!

1 Answer 1

0

you can define the version when enqueuing the file :

add_action("wp_enqueue_scripts", function () {

    wp_enqueue_style(
          "child-style"
        , get_stylesheet_uri() // = get_stylesheet_directory_uri() . "/style.css"
        , ["parent-style"]
        , wp_get_theme()->version // use the child theme version
    );


});
5
  • Is this supposed to go in the function.php file? In the main or child theme folder? Commented Dec 2, 2019 at 11:06
  • in functions.php of the child theme Commented Dec 2, 2019 at 11:12
  • So I'll paste the code there and I'll see. Thank you! Commented Dec 2, 2019 at 11:23
  • I'm afraid this isn't working. I put the exact same code int the child theme function.php file, but it's still loading the old version of the style.css Commented Dec 5, 2019 at 10:36
  • look the source in the browser to be sure to have style.css?ver=.... Commented Dec 5, 2019 at 10:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.