Twig + wordpress – how to get filemtime for style.css

I’m using twig + timber in my wordpress theme. I have style.css file included in this way

<link rel=”stylesheet” href=”{{ site.theme.uri }}/dist/css/style.min.css” />

I want to add ?ver=xxxx to prevent file caching. My question is how to implement filemtime function? I want to make it like this

<link rel=”stylesheet” href=”{{ site.theme.uri }}/dist/css/style.min.css?ver=1202120210″ />

Read more here:: Twig + wordpress – how to get filemtime for style.css

Leave a Reply

Your email address will not be published. Required fields are marked *