Safari is not loading the styles in my child theme. How can I add a ?var=random to the src of the child theme css to trick Safari into using the new CSS instead cached values?
Hi Brock,
Thank you for writing in, while that is outside the scope of support, I could point you in the right direction with the understanding that it would ultimately be your responsibility to take it from here, you can either clear the cache in your Safari browser manually. Or add a version number to Child Theme’s style.css file to prevent browser cache. You can use microtime() instead of version, that way the param will always unique.
Cheers!
added a new version number to the child theme (using the Pro child theme provided by Themeco) and it does not appear that it is being passed to the href attribute of the link element that calls the child stylesheet.
according to this link this approach no longer works (see last comment under accepted answer please)
Hi Brock,
We’re sorry it didn’t work. Unfortunately, at this point you might need to consult a web developer to achieve this. The link given was just a guide and there might be adjustment and the actual implementation is outside the scope of our support. Thank you for understanding.
From @friech 's earlier response:
WPEX_THEME_STYLE_HANDLE
The linked article uses this to refer to the theme. I assume Themeco
isn’t defining the same variable for your theme. Can you tell what variable is used in the Themeco Pro theme?
Hi Brock,
You can see it on this file:
\wp-content\themes\pro\framework\functions\frontend\styles.php
On line 45, you can see this part:
if ( is_child_theme() && apply_filters( 'x_enqueue_parent_stylesheet', false ) ) {
$rev = ( defined( 'X_CHILD_ASSET_REV' ) ) ? X_CHILD_ASSET_REV : X_ASSET_REV;
wp_enqueue_style( 'x-child', get_stylesheet_directory_uri() . '/style.css', array(), $rev, 'all' );
}
Hope this helps.
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.