• Resolved dipaksaraf

    (@dipaksaraf)


    Hi,

    I am having following error in the js files details of which is appended here

    TypeError: jQuery(...).cycle is not a function
    
    fit: rt_fit

    This error is appearing on line 57 of rotating_tweet.js. I am using latest version of WordPress, with updated version of plugin (1.7.4) with Avada theme. The link to the site is here

    What do you suggest to fix this?

    https://www.ads-software.com/plugins/rotatingtweets/

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Martin Tod

    (@mpntod)

    It’s generally hard to fix these without seeing the site.

    A quick fix might be switching to version 2 of the JavaScript.

    I’ve had problems with the Avada template in the past, mainly because it used to load its own version of jquery.cycle which clashes with the one that Rotating Tweets uses. I thought I had a fix, but it appears I didn’t! But, as said, it’s hard to fix without seeing the site.

    Thread Starter dipaksaraf

    (@dipaksaraf)

    I know that there was problem in past, and you helped to get it fixed, i have shared the link >>https://tallgrasspr.com/ where this problem is appearing.

    Plugin Author Martin Tod

    (@mpntod)

    Moving to version 2 of the Rotating Tweets JavaScript on the Rotating Tweets setting page is probably the fastest way to fix this.

    It does look like the same problem as here however I don’t know why the solution no longer works!

    Does the code:

    wp_deregister_script( 'jquery.cycle' );
        wp_register_script( 'jquery.cycle', get_bloginfo('template_directory').'/js/jquery.cycle.lite.js', array(), false, true);<br />
    	wp_enqueue_script( 'jquery.cycle' );

    still exist somewhere in the Avada theme? Might they – possibly – have changed the name of the script?

    Thread Starter dipaksaraf

    (@dipaksaraf)

    I have not updated the theme or anything. I think I have added Qcapcha on the site, which has resulted in breaking this functionality. However I will retest and confirm.

    Plugin Author Martin Tod

    (@mpntod)

    Yup. It’s QapTcha that’s broken the site. I hadn’t spotted that before.

    It puts in a second copy of jQuery and that’s pretty much guaranteed to wreck everything (including a bunch of Avada functionality) – because everything earlier on the page gets overwritten.

    How did you install it? It appears to be a very poorly written plug-in that doesn’t follow WordPress coding standards.

    One thing that might work would be to set the option for Rotating Tweets to load at the bottom of the page on the settings page. If that doesn’t work, then you will need to uninstall QapTcha.

    Thread Starter dipaksaraf

    (@dipaksaraf)

    I had just added the js files in the custom script section of the theme,

    <!-- include CSS & JS files -->
    <!-- CSS file -->
    <link rel="stylesheet" type="text/css" href="/wp-content/themes/Avada-Child-Theme/jquery/QapTcha.jquery.css" media="screen" />
    
    <!-- jQuery files -->
    <script type="text/javascript" src="/wp-content/themes/Avada-Child-Theme/jquery/jquery.js"></script>
    <script type="text/javascript" src="/wp-content/themes/Avada-Child-Theme/jquery/jquery-ui.js"></script>
    <script type="text/javascript" src="/wp-content/themes/Avada-Child-Theme/jquery/jquery.ui.touch.js"></script>
    <script type="text/javascript" src="/wp-content/themes/Avada-Child-Theme/jquery/QapTcha.jquery.js"></script>
    
    <script type="text/javascript">
      $(document).ready(function(){
        // Simple call
       $(".QapTcha").QapTcha();
    });
    </script>

    Plugin Author Martin Tod

    (@mpntod)

    That’s handy. It should be an easy fix. Just remove this line:

    <script type="text/javascript" src="/wp-content/themes/Avada-Child-Theme/jquery/jquery.js"></script>

    and go with

    <!-- include CSS & JS files -->
    <!-- CSS file -->
    <link rel="stylesheet" type="text/css" href="/wp-content/themes/Avada-Child-Theme/jquery/QapTcha.jquery.css" media="screen" />
    
    <!-- jQuery files -->
    <script type="text/javascript" src="/wp-content/themes/Avada-Child-Theme/jquery/jquery-ui.js"></script>
    <script type="text/javascript" src="/wp-content/themes/Avada-Child-Theme/jquery/jquery.ui.touch.js"></script>
    <script type="text/javascript" src="/wp-content/themes/Avada-Child-Theme/jquery/QapTcha.jquery.js"></script>
    
    <script type="text/javascript">
      $(document).ready(function(){
        // Simple call
       $(".QapTcha").QapTcha();
    });
    </script>

    and everything should be fine

    Thread Starter dipaksaraf

    (@dipaksaraf)

    Martin,

    Thanks for yourhelp. I had already tried to not use this jQuery version, but was getting #typeerror, so what I did is change the Jquery.Cycle to version 2, and load it in footer instead of header ( Your default setting). This resolved the issue, I guess, this was loading in footer is causing the jQuery.Cycle to load lately after Qaptcha.

    Plugin Author Martin Tod

    (@mpntod)

    Cool. Glad we got to a solution! ??

    Thread Starter dipaksaraf

    (@dipaksaraf)

    Thanks Martin. I love your prompt response in this matter, and have always appreciated your support to this plugin.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘TypeError: jQuery(…).cycle is not a function’ is closed to new replies.