Hi,
I’d recommend adding what you have there from the other plugin you mentioned if you require noConflict mode. I normally use this as a standard to go by when writing my scripts. I have not run into issues with any other plugins written.
Hi Zach. Thanks for your reply.
Truly, I don’t require noConflict mode. I just thought it would be better to use it because the WordPress bundled version uses it.
That said, I’m not sure what your recommendation meant. Are you saying one could add the code from the other plugin to your plugin?
No, more like just adding this to your site specific plugin or functions.php file:
function wp_jquery_noconflict() { ?>
<script type='text/javascript'>try{jQuery.noConflict();}catch(e){};</script>
<?php }
I tried this in functions.php and I didn’t notice a change in the html. Is this line supposed to appear after jQuery? Does it need to be hooked in somewhere?
Did you hook that into wp_head() after jQuery has been loaded? If you do something like:
add_action(‘wp_head’, ‘wp_jquery_noconflict’);
it should get you off on the foot. A developer can help you further. Like I mentioned, I have never had to do that personally, but if you do need this workaround, that should do it. Thanks.
Thanks, again, for your suggestions, Zach. I am actually loading jQuery in the footer using the $in_footer parameter of wp_enqueue_script. I’m not sure how to get that function to come in right after jQuery. However, as I said before, this isn’t a requirement. So, I’ll let this one rest.