Back to top

Affiliate Link: Looking to Monetize With Ads?? We Personally Use:

Ezoic

Jquery Related Plugins Don’t Function Correctly

Featured Tiles
As an Amazon Associate we earn from qualifying purchases made on our website. If you make a purchase through links from this website, we may get a small share of the sale from Amazon and other similar affiliate programs. You can read our complete legal information for more details.

Many of the favorite plugins people will add to their site use JQuery to interact in the post and user area on the pages and posts.

In Acabado to be lean and fast Jquery was removed if only a specific set of plugins are running.

List Of Plugins Which Enable Jquery

  • DIVI
  • Elementor
  • Jetpack
  • Ninja Forms
  • Convertplug

Now without installing any of those you can disable JQuery yourself by editing the theme. This has its own issues as you will lose this modification on any update and need to modify it again.

How to Allow JQuery With Code Snippet (Preferred)

How to Manually Allow JQuery

The good news is you don’t have to install those if you don’t need them the below steps outline disabling this yourself.

  1. Open Appearance
  2. Open Theme Editor
  3. Find Functions.php in the Right Menu
  4. Search for the below (around line 417)
//Deregister jquery if both Divi Builder and Elementor are not active
			if( ! is_plugin_active( 'divi-builder/divi-builder.php' ) &&
					! is_plugin_active( 'elementor/elementor.php' ) &&
					! is_plugin_active( 'popup-addon-for-ninja-forms/nf-popups.php' ) &&
					! is_plugin_active( 'jetpack/jetpack.php' ) &&
					! is_plugin_active( 'convertplug/convertplug.php' ) ) {

				wp_deregister_script( 'jquery' );
			}

Comment out the deregister command:

wp_deregister_script( 'jquery' );

So it should look like this afterward

//Deregister jquery if both Divi Builder and Elementor are not active
			if( ! is_plugin_active( 'divi-builder/divi-builder.php' ) &&
					! is_plugin_active( 'elementor/elementor.php' ) &&
					! is_plugin_active( 'popup-addon-for-ninja-forms/nf-popups.php' ) &&
					! is_plugin_active( 'jetpack/jetpack.php' ) &&
					! is_plugin_active( 'convertplug/convertplug.php' ) ) {

				// wp_deregister_script( 'jquery' );
			}

Then you can go test your plugin to see if it is able to function correctly without issue.

About Josh Koop

Hey Everyone! I hope that the short article you read today has taken you from a place of frustration to a place of excited anticipation for your visitors! Please let me know of anything you need for Acabado that can help you achieve your goals!

My Posts | Website

Josh Koop

Hey Everyone! I hope that the short article you read today has taken you from a place of frustration to a place of excited anticipation for your visitors! Please let me know of anything you need for Acabado that can help you achieve your goals!

21 thoughts on “Jquery Related Plugins Don’t Function Correctly

  1. Hi Josh,

    I’m using Flywheel to build a test site with Acabado, and I’m having trouble getting jQuery to work consistently.

    I enabled jQuery using each of the following methods:
    1.) I installed Elementor
    2.) I commented out line 417 of the theme’s functions.php file

    But, regardless of how I enable jQuery, it only seems to work sporadically. When the script doesn’t load, I see “ReferenceError: Can’t find variable: jQuery” in the Console. If I refresh the page after an incomplete load, it usually displays as expected.

    I noticed the scripts in Acabado are set to load with async and defer. I’m not sure if this is the culprit, but if so, is there a way to exclude a particular plugin from loading with async and defer?

    I’d appreciate any thoughts or suggestions you might have.

    Thanks in advance!

    1. Is this a local flywheel on your pc or their hosting? I would be interested to know if they are doing something different as I have it on 3 cloud hosts, Bluehost and another host and haven’t seen that behavior. Information can help figure out what you have, do you run plugins like autoptimize or others which defer a lot of scripts if clicked?

      1. Thanks for the quick reply…
        -I’m using local flywheel on my PC
        -I haven’t installed any optimization plugins like autoptimize
        -I think I’m seeing the same thing on your site. For instance, when I look at the web inspector for this page, I see .

          1. The comment form won’t allow me to input the code snippet, but I see lines of text/javascript code on this page that include references to async and defer.

        1. Well this site is a bad choice for that error as I am running Elementor and DIVI which probably conflict with each other plenty unless I turn them off (asset cleanup) and I dont manage that on each post as I should.

          I will say that depending on the site (since this is bluehost) there is sometimes where it lags for 3-4 seconds before kicking everything in (lite the TOC on the side, I can tell when the host is slow as I get odd behavior that I dont see on other hosts.

          I’ll install Flywheel on my pc the next chance I get to play around, I wonder if they run things in a modified way due to the local setup. I have read about it before but hadnt used it.

          1. Thanks for looking into this, Josh. One plugin I experienced the issue with was “WP Triggers Lite.” Sometimes it works and other times it doesn’t. Perhaps it’s lagging like you’ve experienced with your ToC plugin. Not sure.

      1. Most of the time it is due to plugins combating each other. The only thing for most plugins is to ensure JQuery runs right and that the plugins aren’t fighting with each other.

  2. Hey, Josh.

    Another plugin with similar behavior is Store Locator Plus. Sometimes the map loads and other times it does not.

    Thanks

      1. Did you do manual JQuery or my code snippet? I recommend the Code Snippet for all use as it makes it higher priority to load which makes it better performing for us.

          1. So what plugin is it and what other plugins do you run? Many times this is broken by running plugins that “organize” your JavaScript and try to have it load later which does cause issues with plugins loading if you can see them too soon.

  3. Hey Josh, Reference the moodfoodquiz.com question I had earlier today where I am having trouble getting the shortcode quiz to show up on the site. Since I have elementor installed, wouldn’t jquery already be enabled and should be working? Or do I have to enable jquery somewhere else?

    1. Regardless, you have Jquery not loaded errors when loading the main page. Enabling Jquery through the snippet frees you from it being a cause.

      1. Ok, I understand now and I made the changes in functions.php but when I tried to update/save the file it said this, “Something went wrong. Your change may not have been saved. Please try again. There is also a chance that you may need to manually fix and upload the file over FTP.” Is Acabado not allowing edit of the functions.php ? or do I have to enable something that will allow my edit/changes to functions.php to be saved.

        1. I recommend this version instead as a theme change will revert on update which means you have to remember to continuously replace it.

          https://acabadotheme.com/enable-jquery-with-code-snippets-no-more-theme-edits/

  4. Hey Josh, Reference the moodfoodquiz.com I made the changes in functions.php but when I tried to update/save the file it said this, “Something went wrong. Your change may not have been saved. Please try again. There is also a chance that you may need to manually fix and upload the file over FTP.” Is Acabado not allowing edit of the functions.php ? or do I have to enable something that will allow my edit/changes to functions.php to be saved.

    Thanks for help

  5. Hello Josh, I tried the Plugin Method yo active JQUERY but seems not working for me, I want to unable the Onesignal, Cookie consent banners.

    1. Do you use caching or minification of Javascript? Because I ran onesignal on here for a week or two without issue.

Leave a Reply

Your email address will not be published. Required fields are marked *

Recent Content