This topic has 3 replies, 2 voices, and was last updated 8 years by Radu.

  • Author
  • #128046
     simlim
    Participant

    When I make an update to the default style.css in my child theme (which is included automatically), what is the best way to update the version so my users can see it without the need to manually refresh the browser?

    #128106
     Radu
    Moderator

    Hi,

    Child theme don’t need to be updated, only parent should be !

    If you add some css to child theme/style.css after the file is updated the next visitor when accessing the page will be loaded with your latest css declarations.

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #128474
     simlim
    Participant

    Hi,

    Not really, the style.css version always indicates the same version as the parent theme (e.g. style.css?v=4.08), this will remain cached unless the client clear the cache even if the stylesheet changed.

    Anyway for the benefit of others, the solution is to basically avoid using the default style.css and include your own stylesheet where you can control the version through https://developer.wordpress.org/reference/functions/wp_enqueue_style/, unless you only change the default style when the parent theme upgrades.

    #128503
     Radu
    Moderator

    Hi,

    From what i know links with parameters in URL like this : style.css?v=4.08 cannot be cached by default and it treated as dynamic resource anyway, you can open style.css file from child and change theme version from there.

    The styles can be loaded also in wp-admin -> theme options -> general settings -> quick css

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 4 posts - 1 through 4 (of 4 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?