Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Evan Herman

    (@eherman24)

    Since the error code states that jQuery can’t be found, that leads me to believe that a) your theme is de-registering and enqueueing it’s own version of jQuery (which is a no-no) and it’s conflicting with the javascript included in the plugin, your theme isn’t loading jQuery on the page your trying to load the form on, or you have another plugin installed that is conflicting with our scripts which are required for the plugin to function properly.

    What theme are you using?

    Thanks,
    Evan

    Plugin Author Evan Herman

    (@eherman24)

    I can see in your enqueued scripts that your theme is using mootools and not jQuery, which would most likely be the problem.

    Thanks,
    Evan

    Thread Starter reblevins

    (@reblevins)

    Thanks for the quick reply! So, yeah, I guess that would be the problem. I’m using Rockettheme’s Vermilion. Can I just enqueue jQuery in my functions.php file? Or will that cause all hell to break loose?

    Plugin Author Evan Herman

    (@eherman24)

    No, I would image that if you enqueue a version of jQuery on that page things would resolve themselves. Let us know if they do, I’d be interested in finding out.

    Evan

    Thread Starter reblevins

    (@reblevins)

    Ok, so it looks like that worked. Haven’t tried any other javascript thingies like lightboxes, etc, so can’t be 100% sure of compatibility.

    For the googlers who come across this, this is what I added to my themes functions.php file:

    //Making jQuery Google API
    function modify_jquery() {
    	if (!is_admin()) {
    		// comment out the next two lines to load the local copy of jQuery
    		wp_register_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js', false, '2.1.1');
    		wp_enqueue_script('jquery');
    	}
    }
    add_action('init', 'modify_jquery');

    You could probably get fancy and check for just that page, but that’s something for another day. Hope it helps someone else.

    Thanks again for the help.

    Plugin Author Evan Herman

    (@eherman24)

    No problem at all. I’m glad that helped you find a solution.

    One tip, most developers recommend working with the core bundled jQuery, and not enqueuing one from the Google CDN.

    You can easily enqueue the core version of WordPress by writing wp_enqueue_script( 'jquery' ); and it will load the one bundled with core. It will also save you an extra HTTP request the CDN (unless your caching).

    Either way, glad things worked out!

    Evan

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Can't find variable: jQuery using shortcode on pages’ is closed to new replies.