Support » Theme: Consulting » Link (eg style.css) query string version uses parent version, should use child

  • Resolved scottbrownconsulting


    The link rel=’stylesheet’ id=’consulting-thinkup-style-css’ rendered into the head of all pages to bring in the Consulting theme’s style.css appends a query string with the Consulting theme’s current version. This is standard practice of course.

    The problem is, in a derived child theme the style.css is now that of the child theme, but the appended version is still the parent theme’s (Consulting’s) version. So that if changes are made to the child theme style.css that bump its version, the query string does not change to reflect it, and browsers don’t know to update their cached version. The result is the obvious one: either you have to force a cache update with F5 or you won’t see the changes.

    This is managed on line 122 of consulting/functions.php where you have:

    wp_enqueue_style( ‘consulting-thinkup-style’, get_stylesheet_uri(), ”, $consulting_thinkup_theme_version );

    Instead of $consulting_thinkup_theme_version, please use wp_get_theme()->get(‘Version’)

Viewing 1 replies (of 1 total)
  • Thread Starter scottbrownconsulting


    Never mind, I resolved this on my own by enqueuing styles the new way instead of the old @import way, and tweaking the params to wp_enqueue_style() to get the versions pulled from the parent and child just right.

Viewing 1 replies (of 1 total)
  • The topic ‘Link (eg style.css) query string version uses parent version, should use child’ is closed to new replies.