Skip to main content

Tips and Tricks: What We Pick Up Along The Way Part 1

June 28, 2016
|

Developers on all sides of the coding table run into walls on a rather regular basis, particularly entry-level developers. We tend to frequently need help but because the workloads never cease, we have to very quickly learn how to handle our problems alone. Of course, that’s not to say that 100% of issues should be handled solo. We can never be afraid to ask our wiser coworkers for help or at the very least a push in the right direction. The best tool we can pick up in our time sinking is how to efficiently search for the solution to your problem. Of course, as we solve more of the same problems regularly, the solution eventually becomes engraved in our minds and we can begin swimming. Until then, we’re stuck flexing our Google-Fu.

This Tips and Tricks series will be dedicated to the little solutions we find along the way. The ones that are not as readily available on Google without connecting some dots first.

#1) WordPress, Revolution Slider, and Chrome

This issue came up as I locally developed a new site from a fresh Blank theme. There were no plugins except the bare minimum active and WP core was up to date. This was a problem I had not seen before, having previously worked with Revolution Slider a handful of times.

The Problem:

RevSlider was not working in the backend or the frontend.

The Process:

A quick look at the Console under Inspect Element while in the plugin’s backend showed an error: Uncaught TypeError: wp.template is not a function. Weird, haven’t run into this one before. I grabbed a fresh copy of the plugin from CodeCanyon and installed it. And blamo! One problem down.

Now I can visit the individual slides but the options for editing were not responding. No adding images, html, buttons, shapes, videos. Nada. I decided to visit the backend in Firefox and was able to work within the plugin; however, nothing displayed on the frontend. I then checked for console errors on the frontend and found that 2 errors were continuously being reported, quickly stacking up into the thousands – Uncaught TypeError: Failed to execute ‘closest’ on ‘Element’: 1 argument required, but only 0 present.  jquery.themepunch.tools.min.js?ver=5.2.5.4:58. 

The Solution:

I have been working off of a Blank theme that was handed to me about a year ago and I’ve been updating it piece-by-piece ever since. And perhaps something changed with this latest version of WP, 4.5.3, but the jQuery version the theme has been pulling from was a little outdated and decided this was a great time to inform me of that, in a roundabout way. Updating that link to the newest jQuery library, 3.0 solved everything!

Moral of the Story:

Check your site’s jQuery version.