E: info@davidjlampe.com | T: 608.333.3319

Updated to WordPress 4.5 – Theme fuctions stop working

If you are here, you most likely just updated your WordPress website to the latest version 4.5 and all of a sudden all sorts of things stopped working.

The problem with WordPress 4.5 isn’t that it uses jQuery 1.12.3. The problem is that older versions of jQuery allowed poorly written, malformed, or just plain broken JavaScript to “hide”. In the ever-increasing effort to close security holes and tighten up the running environment of JavaScript, version 1.12.3 will stop running ALL scripts and report an error if something is wrong. So naturally you head to the Googler and what you will find is multiple responses of –

a[href*="#"]:not([href="#"])
Another example would be a[href=#scroll-to-top]
which, when written correctly, should be
a[href="#scroll-to-top"]

Ok, great, what now? First, find the author of your theme and see if there is an update to your theme. Some authors have started including updates to remedy this issue. Next, If your theme is up-to-date and you are still having an issue, go through your plugins one by one and Deactivate them. Then see if the issue has been fixed. If, so, awesome! What you found was a plugin that needs to be updated. Find the author and look for an update.

So you did all that and you still have an issue, now what. One thing you can do is roll back the Jquery version that is loaded. You will need ftp access to make this work, so if you do not have access to your ftp account, contact the administrator or host.

When you are in your FTP client go to wp-includes folder. You will be editing the file script-loader.php.

script-loader

Download this file and save a copy.

jquery

Go to line 182 and change the version to 1.11.3 on line 182 and 183. Save the file replace the file in your ftp.

That’s it! You will now be loading the rolled back version of Jquery. Developers are constantly updating plugins and themes, so they will starting to use the latest version of Jquery. At some point will most likely want to come back and change this to the latest Jquery but for now, your site works like it used to and you arent waiting on an author with a broken site!

Leave a Reply