admin管理员组文章数量:1420166
WordPress default theme CSS version problem and not loading.
After change the css code not apply the old css only load.
we manually the style version the new code load.
style.css?ver=5.1 to style.css?ver=5.2
How to change wordpress default theme style.css version in WordPress v 5.1
WordPress default theme CSS version problem and not loading.
After change the css code not apply the old css only load.
we manually the style version the new code load.
style.css?ver=5.1 to style.css?ver=5.2
How to change wordpress default theme style.css version in WordPress v 5.1
Share Improve this question edited Jul 13, 2019 at 6:25 fuxia♦ 107k39 gold badges255 silver badges459 bronze badges asked Jul 13, 2019 at 4:24 SNSSNS 1731 silver badge14 bronze badges 2- I don’t understand the question. Why do you need to change just the version of the default theme’s CSS? – Jacob Peattie Commented Jul 13, 2019 at 4:30
- we changed in css code not apply.. 'style.css?ver=1' then we change manually 'style.css?ver=2' it loading new code – SNS Commented Jul 13, 2019 at 4:31
1 Answer
Reset to default 0you can pass time() function in version parameter. so you dont have to change version to update a css code.
function add_dynamic_version_css_scripts() {
wp_enqueue_style( 'dynamic-style', get_template_directory_uri() . '/css/custom-style.css','style-css', time() );
}
add_action( 'wp_enqueue_scripts', 'add_dynamic_version_css_scripts' );
let me know if this works for you.
本文标签: WordPress default theme CSS version problem and not loading
版权声明:本文标题:WordPress default theme CSS version problem and not loading 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745325357a2653567.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论