[Support request] How to enable jquery only for pages that requires it?

Home Forums Support [Support request] How to enable jquery only for pages that requires it?

Home Forums Support How to enable jquery only for pages that requires it?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #754331
    Silvio

    I installed easy digital downloads and Bigfootjs that require jquery and sometimes i get a jquery error. How can I tell Wrp to load it only if required?

    #754469
    David
    Staff
    Customer Support

    Hi there,

    what is the error you are getting? jQuery should get cached after first load so shouldn’t get called multiple times.

    #755289
    Silvio

    if you inspect my website vivereintenzionalmente.com you see two errors:

    – can’t find variable jquery in notes-common-v2.js
    – can’t find variable in admin-bar-v2.js

    I read something about jquery related to generatepress and I am not sure if I need to do something.

    I have bigfoot on mywebsite and the code is in my child function

    function sg_add_bigfootscripts_yo() {
      wp_enqueue_script( 'bigfoot.min.js', get_stylesheet_directory_uri() . '/js/bigfoot.min.js', array('jquery'), false, false );
    }
    
    add_action( 'wp_enqueue_scripts', 'sg_add_bigfootscripts_yo' );
    
    function sg_add_head() { ?>
      <script type="text/javascript">
      jQuery.bigfoot();
    </script>
    <?php }
    add_action( 'wp_head', 'sg_add_head' );
    
    #755397
    David
    Staff
    Customer Support

    I have tried visiting your (staging) site from other topics and i am getting an Invalid SSL error and it won’t let me access it. Let me know if you have a new link

    #755421
    Silvio

    sorry, I added the link, here I am asking for the live https://vivereintenzionalmente.com

    #755476
    David
    Staff
    Customer Support

    Hi there,

    i have been through the site and have not seen those errors. Can you try clearing your caches and opening the site on an incognito / private browser?

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.