Support » Networking WordPress » Sites on Multisite Network seem to be using different child theme file versions

  • Resolved callumfromclay10

    (@callumfromclay10)


    I have a child theme of Divi theme with some custom stylesheets, functions.php and a functions.js file. I am trying to update some javascript in the functions.js file.

    I update the file and using DevTools, I can see the files in one site on the network are the most up to date files, but the base site still has old versions of the files.

    And it seems site with the updated files is using the old file versions.

    In my functions.php file I have the following code to enqueue the child theme and my script. I have tried changing the version, removing, refreshing my cache (browser and the breeze cache on the site) and I still can’t seem to get the updated code.

    Any ideas on what I could be doing wrong?

    Thanks!

    • This topic was modified 1 week, 6 days ago by James Huff. Reason: moved to Networking WordPress since this is a multisite issue
Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    As you are surely aware, all network sites with the same active theme all utilize the same source code files. So if you’ve changed the enqueued version in functions.php, we should see all sites use this updated version. The only reason for an older version to appear would have to be caching since the older version no longer physically exists anywhere.

    I know you said you refreshed caches. Are you sure you refreshed all involved? Do you use a reverse proxy service like Cloudflare or similar? There could be active caching there which is often overlooked.

    it seems site with the updated files is using the old file versions.

    I don’t see how that’s possible since there is physically no longer an old file version anywhere (unless cached). If you are seeing old behavior despite using an updated file, I would suspect there’s a flaw in your updated code that’s preventing it from working as expected.

    In DevTools, check the network tab to confirm the latest versions are being requested. Click on the updated file’s entry and choose the Response view. You should see your updated code here. If it’s there but you don’t see the expected behavior, I suspect your code is flawed. Are there any JS errors listed in the console? Fatal errors in unrelated code can still prevent yours from functioning correctly.

    Thread Starter callumfromclay10

    (@callumfromclay10)

    I managed to work out what was going on. I feel like a bit of an idiot haha. So basically, before I realised you could enqueue scripts as part of the child theme, I had loaded the javascript files via the footer. So it was loading the newer file then loading the older (I guess cached) file, so the old function was being used. Thanks for the help, looking in the dev tools helped me work out what was actually being loaded and when.

    Moderator bcworkz

    (@bcworkz)

    Heh, I’ve made the same kind blunder multiple times! Fortunately it’s usually with PHP where we get an error when we try to override functions like that. JS happily uses the unintended code without complaint.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.