Join the Soledad Facebook Users Group here
for Share, assistance, discussion, and Updates related to Soledad WordPress Theme.

If you can't create a new ticket - you can send us an email via our contact form and we will get back to you.

Okay
  Public Ticket #3251487
Style.css update
Closed

Comments

  • geekzilla started the conversation

    Well, I would like to force the update of the style.css of my theme on clients browsers (I dont have access to the machines), it´s the web in general.

    I´ve tried using the following code to the functions.php file

    function mytheme_enqueue_styles() {
        $parent_style = 'parent-style';
        $theme_version = wp_get_theme()->get('Version');
        
        wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css', array(), $theme_version );
        wp_enqueue_style( 'child-style', get_stylesheet_uri(), array( $parent_style ), $theme_version );
    }
    add_action( 'wp_enqueue_scripts', 'mytheme_enqueue_styles' );

    But it didnt work, I think because the version number is being passed somewhere else, as it is show in the source code as 

    <link rel='stylesheet' id='penci-style-css' href='https://www.geekzilla.com.br/wp-content/themes/geekzilla/style.css?ver=6.6.4' type='text/css' media='all' />

    One of way forcing the update would be to change the version everytime I make a update to my css file, but as of now I can´t find where the version is coming from.

    Can you help?

    Thanks!

    EDIT:

    Well I´ve just noticed that right on top of the file there´s the version number, so I changed to 6.6.4.1 and it worked, I just hope that wont mess any future updates.

  •  2,610
    PenciDesign replied

    Hi,

    For this case, please send me your WordPress admin account in a PRIVATE reply.
    I'll log in and try to help you config it.

    Regards,
    PenciDesign.



  • geekzilla replied

    I´m sorry, but that goes all security good practices policies. I would be happy if you would just tell me if that´s the only place the style.css is getting it´s version from and if it can be removed etc.

    But anyway, the solution I mentioned bellow worked for me, changing the version to

    define( 'PENCI_PENNEWS_VERSION', '6.6.4.1' );

    Forced all clients visiting the website to update it´s style.css file. 

    Just so other people searching for the answer understand that will change the final code to 

    <link rel='stylesheet' id='penci-style-css' href='https://www.geekzilla.com.br/wp-content/themes/geekzilla/style.css?ver=6.6.4.1' type='text/css' media='all' />

    I´m just wondering about where the "Penci_Pennews_version" is being called, if you could point it to me.


    Thanks!

  •  2,610
    PenciDesign replied

    Hi,

    The problem is that the browser already caches the content of the old version, so when you add the new version number, the browser will load the new style.css content.

    In this case, you should clear all the site cache, and browser cache then checks again.

    Regards,
    PenciDesign.


  • geekzilla replied

    Hello,

    Nope, actually that's not the problem, that's the solution, , but I've solved already as I explained before, by changing the version number, that's the idea, to change the version so clients will have the new style.css

    It's impossible to ask 10 thousand users to clear their cache. 


    But thanks anyway :)