Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

wp_enqueue_style not adding version

I am trying to add version to style.css file but its not adding version to style.css infact not adding version to any of css files. here's my code

wp_enqueue_style( 'twentyfifteen-style', get_template_directory_uri() . '/css/style.css', array(),'1.0','all');

Does any body knows what is the issue?

Thanks

like image 345
Ali Abdullah Avatar asked Jun 01 '17 00:06

Ali Abdullah


People also ask

How do I change the CSS version in WordPress?

Editing CSS Through WordPress Customizer Instead of using the Theme Editor, try this. Log in to your WordPress backend and click Appearance > Customize to open the theme customization screen.

How do I fix the CSS issue in WordPress?

Regenerating CSS: This can easily be fixed by going to WP admin > Elementor > Tools > Regenerate CSS. Then, you can clear the cache (WP cache and browser cache) and refresh the page. Clearing Site Cache: Check if you have any caching plugins on your site or any server level caching enabled. Clear those caches.

What does this function do Wp_enqueue_style ()?

Function responsible for enqueuing the styles required for block styles functionality on the editor and on the frontend.

How do I add a CSS file to WordPress?

Navigate to Appearance -> Customize section of your dashboard, scroll down to the bottom of the page and click Additional CSS. This will open an in-built tool that will allow you to add any CSS code.


1 Answers

Since you mentioned that none if your stylesheets are getting versions I would suspect a plugin or the theme is filtering those URLs.

Try searching your theme and all plugins for any usage of the style_loader_src filter. You may find the problem there.

like image 194
Jared Cobb Avatar answered Sep 20 '22 01:09

Jared Cobb