Book a Free Call

Timestamp on your CSS and JS in Functions file in WordPress



I’ve been trying to debug on XCode and the caching is very persistent….here’s a quick function to add to your functions file to timestamp your js or css files, so you don’t have to go crazy trying to refresh the cache when you’re working locally.

function versionStamp(){
    return time();
}

wp_register_script('yourreferencehere',get_stylesheet_directory_uri().'/inc/js/ims_mcgrath.min.js?v='.versionStamp());

Need rapid website development:

For smaller projects at high speed


  • Adding script tag embed to Gatsby component

    Read More
  • Get more than 100 queries in GraphQL (I felt stupid)

    Read More
  • Animate on Scroll (AOS) into Nuxt js

    Read More
  • WordPress Super-admin hack

    Read More
  • Add content or ACF field under thumbnail/image gallery in Woocommerce

    Read More

Tags


Categories

Is it urgent? Donate to Cork Simon

Got an urgent issue?

Charlie's Cottage, Carrigrohane, Co. Cork, T12 WY9H

(085) 7686677