
Tagged: cache, caching, child, child theme, CSS, enfold, version, version numer
-
AuthorPosts
-
March 31, 2025 at 2:16 pm #1480526
When I change the css file of my child theme, these changes do not show up at the website.
After searching long, long time, it seems my website loads an old version of the css file. In the source code I see this one being loaded:
/wp-content/themes/enfold-child/style.css?ver=7.1The content of this file, when viewed through the browser, is not the same as the file I’m editing through ftp and a code editor at:
/wp-content/themes/enfold-child/style.cssI’ve been trying hard to find out how to load the right css. For example I’ve deleled browser caches, turned off caching plugin, and also set Enfold Performance settings at:
– Turn off css compression/merging
– Turn on delete old css and js filesNothing seemed to help. Finally asked chatgpt which said:
“It seems that the ?ver=7.1 in the URL of your style.css file is added to indicate the version of the file, which is usually done for caching purposes. If you want the CSS to load without the version parameter, there are several ways to do this, depending on how the version parameter is added. Here are a few possible solutions:”
One of the solutions was adding this code:
function custom_enqueue_styles() { wp_enqueue_style( 'enfold-child-style', get_stylesheet_directory_uri() . '/style.css', array(), false, 'all' ); } add_action( 'wp_enqueue_scripts', 'custom_enqueue_styles' );
That seems to do the trick!
What is happening here?
How can I get this fixed without adding the extra code?Using Google, I see quite some people having issues withc css changes not being visible due to Enfold settings.
Please let me know how all his stuff works, and how I can turn it off or set it in such a way that it just works?
March 31, 2025 at 2:22 pm #1480527Oh no…
No I tried to edit the css and view it at the front end, and again it does not show up. Now the code shows two style.css files in use:
/style.css?ver=6.7.2
/style.css?ver=7.1Both with wrong/old content.
What’s going on?!?
March 31, 2025 at 2:32 pm #1480530I’ve tried the plugin ‘Clear Cache for Me’ (https://wordpress.org/plugins/clear-cache-for-widgets/). That seems to do the trick for now. Change I make to my style.css file through FTP and a code editor immediately show up at the front end.
But I really don’t know why I need an additional plugin.
Can you please shine a light on this?
March 31, 2025 at 3:55 pm #1480533if you open that parent style.css :
/*
* PLEASE DO NOT EDIT THIS FILE!
*
* This file is only in your themefolder for WordPress to recognize basic theme data like name and version
* CSS Rules in this file will not be used by the theme.
* Instead use the custom.css file that is located in your themes /css/ folder to add your styles.
* You can copy a style rule from any of your css files and paste it in custom.css and
* it will override the original style. If you just want to add small css snippets you might also
* want to consider to add it to the designated CSS option field in your themes backend at: Theme Options->General Styling
*/or use the quick css input on enfold (child) options page.
March 31, 2025 at 11:57 pm #1480544Hi,
Please note that testing with Safari can be hard to clear the cache, often you need to also clear the history to fully purge the cache, following these steps for Safari and note Step 4 where you will Clear the History.Best regards,
MikeApril 1, 2025 at 7:51 am #1480562I’m not using Safari, I’m using Firefox Developer Edition. Tried Chrome and Brave too.
April 1, 2025 at 10:51 am #1480567if you are using a child-theme – the child-theme style.css could be used – but isn’t it much easier to use the quick css of your enfold child – general styling – quick css
Quick CSS
Just want to do some quick CSS changes? Enter them here, they will be applied to the theme. If you need to change major portions of the theme please use the custom.css file or the Enfold Child theme.April 1, 2025 at 10:54 am #1480568Next – on dashboard – themes : how many enfold installations you see there?
there had to be only the enfold child – and the enfold theme ( and not so important the standard wordpress themes)April 1, 2025 at 10:57 am #1480569I know I can do that, mainly use it for quick changes and checks.
For more extensive changes and long term maintenance I prefer the external css file – which should not be a problem.
April 1, 2025 at 10:58 am #1480570There’s only one Enfold and one Enfold Child theme
April 1, 2025 at 7:58 pm #1480595So why not follow the recommendation and use custom.css instead?
April 2, 2025 at 6:21 am #1480615Hi,
Thank you for the update.
Where can we check the issue? Please provide the site URL and login details in the private field so we can check it properly. Adding the wp_enqueue_scripts hook above is not necessary because the style.css in the child theme should be loaded by default. Did you subscribe to a CDN provider?
Best regards,
IsmaelApril 2, 2025 at 8:03 am #1480622Hi Ismael, thanks for reaching out.
Unfortunately we cannot try and solve it right now, since it’s a website that should have been launched yesterday. Due to another software developer not getting his external part up and running, I need to make some last minute changes and launch the site today; it’s too busy right now since it’s a very important debt counseling website in the southern region of our country.
It’s fine to get things done for the time being with the ‘Clear Cache for Me’ plugin and/or editing through the css field in Enfold theme settings.
If necessary, I’ll get back to this ticket later again.
April 2, 2025 at 12:08 pm #1480641 -
AuthorPosts
- You must be logged in to reply to this topic.