Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #884877
    mobnew
    Participant

    I have recently installed ConvertPlug on my site (ironreserve.com) and created a modal popup. Unfortunately I am receiving an error when attempting to submit an email address. I have narrow the issue down to the fact that jQuery is being loaded twice, once in my functions.php file and once by ConvertPlug. I am hoping there is a fix to this issue. Currently I am loading jquery in my functions.php by using the following code:

    function wpb_adding_scripts() {
    wp_deregister_script(‘jquery’);
    wp_register_script(‘jquery’, ‘https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js’, false, ‘1.11.3’);
    wp_enqueue_script(‘jquery’);
    }
    add_action( ‘wp_enqueue_scripts’, ‘wpb_adding_scripts’ );

    #885644
    Christopher
    Moderator

    Hi there,

    Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link to your site
    – WordPress Admin username / password
    – FTP credentials

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    Thanks.

    #888186
    mobnew
    Participant
    This reply has been marked as private.
    #888659
    Rupok
    Member

    Hi there,

    Thanks for updating. I can see only jQuery 1.11.3 is loading to your site. How did you find the duplicate jQuery? Is it loading by another plugin?

    Let us know.

    Cheers!

    #888746
    mobnew
    Participant

    Yes, that is my concern. I am receiving an “Uncaught ReferenceError: smile_ajax is not defined” from the modal.min.js file when the page loads and then again when someone tries to submit their email address to sign up. This occurs only when the ConvertPlug campaign is live.

    The typical response I can find that relates to this type of error is that the plugin is loading jQuery twice.

    #889406
    Paul R
    Moderator

    Hi,

    I would like to check but the wp and ftp login you provided no longer works.

    Please remove the code in your child theme’s functions.php file that adds the jquery.

    No need to add it as it is already being loaded by wordpress.

    Thanks

    #889839
    mobnew
    Participant
    This reply has been marked as private.
    #890893
    Lely
    Moderator

    Hi There,

    I tried to login via FTP to check the custom template. Unfortunately, the credentials is not working. Please check the attached screenshot of the error I am getting. Please check.

    #892287
    mobnew
    Participant
    This reply has been marked as private.
    #892313
    mobnew
    Participant

    To clarify, the SFTP connection required.

    #893152
    Rue Nel
    Moderator

    Hello There,

    Thanks for updating the login credentials. We were able to login. You need to remove your code, removing and adding the jQuery;

    function wpb_adding_scripts() {
      	wp_deregister_script('jquery'); 
    	wp_register_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js', false, '1.11.3'); 
    	wp_enqueue_script('jquery');
    }
    add_action( 'wp_enqueue_scripts', 'wpb_adding_scripts' );  

    Please be advise that X theme and most plugins rely on the latest jQuery version loaded in WordPress. We are using the standard version bundled with WordPress to avoid any conflict that may occur. Since you have changed it, there is no way to account any issues that would occur after doing so. As this is all your customizations, regretfully we won’t be able to assist further. Custom development is outside the scope of our support. We’re happy to provide advice and get you started in the right direction, but you would still be responsible for the implementation.

    Thank you for your understanding.

    #893456
    mobnew
    Participant

    Thank you for the help. I would love any advice to get me started in the right direction. I am not asking for support with customization, rather just need to know the best place to load jQuery libraries and code within the theme.

    My understanding before purchasing the theme was that custom page templates could be created. I have utilized this feature to add jQuery to each page when necessary. Unfortunately the custom jQuery is essential to each page.

    Thank you in advance, Jason.

    #894496
    Rad
    Moderator

    Hi there,

    It’s not about the theme or plugin, it’s WordPress’s standard. You can’t just use any jQuery library even if it’s from google CDN. Just note that WordPress uses a noConflict() feature to avoid conflicts with other libraries.

    Then you’re loading another library from Google CDN that has no noConflict() declaration, hence, destroying the structure of current WordPress’s functionalities that are dependent to noConflict().

    The question will, why do you need another jQuery library? For what purpose and what code should be using that library.

    You can’t add code using this $(), you can only do it with this jQuery(). But, you can always wrap your code with jQuery() so you can freely use $(). For example,

    jQuery ( function($) { 
    //Let's declare $ as jQuery instance and since this is local function, then, there should be no conflict with outside library
    
    //Then your code here that uses $()
    //Example
    $('body').css( { color: '#fff' } );
    
    } );

    Thanks!

    #895212
    mobnew
    Participant

    Rad,

    Thank you for the response. I had tried that solution before starting this thread which had create additional errors. I will follow your lead and then continue attempting to resolve the new errors. I am using the additional jQuery libraries for functions relevant to our site.

    #896225
    Rad
    Moderator

    Hi there,

    Sure, please let us know if you’re having more issues with that setup. I’m more happy to provide recommendation 🙂

    Thanks!

  • <script> jQuery(function($){ $("#no-reply-884877 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>