Tagged: x
-
AuthorPosts
-
April 15, 2016 at 4:17 pm #884877
mobnewParticipantI 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’ );April 16, 2016 at 6:53 am #885644
ChristopherModeratorHi 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 credentialsDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
Thanks.
April 18, 2016 at 7:59 am #888186
mobnewParticipantThis reply has been marked as private.April 18, 2016 at 12:42 pm #888659
RupokMemberHi 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!
April 18, 2016 at 1:36 pm #888746
mobnewParticipantYes, 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.
April 19, 2016 at 1:57 am #889406
Paul RModeratorHi,
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
April 19, 2016 at 6:35 am #889839
mobnewParticipantThis reply has been marked as private.April 19, 2016 at 5:57 pm #890893
LelyModeratorHi 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.
April 20, 2016 at 1:41 pm #892287
mobnewParticipantThis reply has been marked as private.April 20, 2016 at 1:52 pm #892313
mobnewParticipantTo clarify, the SFTP connection required.
April 21, 2016 at 2:11 am #893152
Rue NelModeratorHello 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.
April 21, 2016 at 6:27 am #893456
mobnewParticipantThank 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.
April 21, 2016 at 7:00 pm #894496
RadModeratorHi 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!
April 22, 2016 at 6:48 am #895212
mobnewParticipantRad,
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.
April 22, 2016 at 11:10 pm #896225
RadModeratorHi there,
Sure, please let us know if you’re having more issues with that setup. I’m more happy to provide recommendation 🙂
Thanks!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-884877 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
