Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter animalapp

    (@animalapp)

    Diana, first of all, top support, on point and quick response, appreciate it very much.

    Trying the first link you provided: http://biostall.com/how-to-load-jquery-in-the-footer-of-a-wordpress-website/
    I was prompted to add the following code:
    view plaincopy to clipboardprint?

    function my_init()   
    {  
        if (!is_admin())   
        {  
            wp_deregister_script('jquery');  
      
            // Load the copy of jQuery that comes with WordPress  
            // The last parameter set to TRUE states that it should be loaded  
            // in the footer.  
            wp_register_script('jquery', '/wp-includes/js/jquery/jquery.js', FALSE, '1.11.0', TRUE);  
      
            wp_enqueue_script('jquery');  
        }  
    }  
    add_action('init', 'my_init');

    to the functions.php file found through the theme editor. Doing this PLUS setting the scripts on the footer seems to have fixed everything. Thanks again.

    Thread Starter animalapp

    (@animalapp)

    I get the same error, Jquery not defined

    Thread Starter animalapp

    (@animalapp)

    Hello Diana, first thanks for your quick reply, is aw it immediatley but held from replying until i tested your suggestions.

    1. I disabled all plugins except the bare minimums, i only had one optimization plugin which my wordpress subscription installed by default called “Page Optimize” by Automattic. I disabled it and everything which was not bare bone while on that task and it had no effect.

    2. Setting the custom js to load in the footer rather than the header actually worked! for every page except 2:
    a. animalapp.co/profile
    b. animalapp.co/logout
    I have no idea specifically why these two pages continue with the error, i tried loading them on the header just in case and it had the same effect so I proceeded to try your 2nd solution:

    3. “search for the plugin or the PHP snippet that moves the jQuery to the footer and make it load in the header.” I’m new to wordpress, we used to just handle the entire backend and front end ourselves, so my knowledge is limit here and I honestly have no clue how to do this, i tried going through the themes files and did not find anything.

    Switching the scripts to the footer worked for all other pages, I could not isolate why those 2 pages specifically still have the same error.

    P.S I also tried switching to an entirely different theme to see if it had any effect and it didn’t.

    Thread Starter animalapp

    (@animalapp)

    Debug Info:

    ### WordPress Environment ###
    Home URL: https://animalapp.co
    Site URL: https://animalapp.co
    WP Version: 5.5.1
    CCJ Version: 4.21.3
    WP Multisite: false
    WP Memory Limit: 256M
    
    ### All codes ###
    Array
    (
        [all] => Array
            (
                [0] => 761.js
                [1] => 753.js
                [2] => 715.js
                [3] => 714.js
                [4] => 712.js
                [5] => 711.js
                [6] => 710.js
                [7] => 709.js
                [8] => 685.js
            )
    
    )
    ### Search tree ###
    Array
    (
        [5] => Array
            (
                [frontend-js-header-internal] => Array
                    (
                        [0] => 761.js
                        [1] => 753.js
                        [2] => 715.js
                        [3] => 714.js
                        [4] => 712.js
                        [5] => 711.js
                        [6] => 710.js
                        [7] => 709.js
                        [8] => 685.js
                    )
    
            )
    
    )
    Thread Starter animalapp

    (@animalapp)

    Hello Joy, thanks for the reply, I made a final edito to the psot and marked it as resolved, ticking “DOMContentLoaded event” option fixed the problem, thanks for the help!

Viewing 5 replies - 1 through 5 (of 5 total)