最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Set version number in child's style.css file

programmeradmin2浏览0评论

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!

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!

Share Improve this question edited Dec 2, 2019 at 11:24 fuxia 107k39 gold badges255 silver badges459 bronze badges asked Dec 2, 2019 at 10:29 GheesGhees 1
Add a comment  | 

1 Answer 1

Reset to default 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
    );


});
发布评论

评论列表(0)

  1. 暂无评论