I got stuck with deregister WP's version of jQuery

Hi,
My new theme got soft-rejected and I got this from reviewer :
Do not deregister WP’s version of jQuery – delete these lines: http://ivor.bz/43pa ( I thought Picture is example not my file )
So, I tried delete my wp_deregister_script(‘jquery’); but it makes my Jquery not work.
My JS load :
Click here for image
please someone point me out please.
Best regards,
Decneo

yeah you never should deregister the jQuery from Wordpress. This is a common rejection reason. From the picture you posted I can see nothing. Your Javascript isn’t probably working because any of the plugin files has troubles with the jQuery Version which is included within Wordpress. I would suggest you to debug your theme and use the inspector to find out which script is causing those issues, remove them and replace them with some alternatives.

infuse01 said
Hi,
yeah you never should deregister the jQuery from Wordpress. This is a common rejection reason. From the picture you posted I can see nothing. Your Javascript isn’t probably working because any of the plugin files has troubles with the jQuery Version which is included within Wordpress. I would suggest you to debug your theme and use the inspector to find out which script is causing those issues, remove them and replace them with some alternatives.

my picture that I’ve posted it works for me but after delete wp_deregister_script(‘jquery’); then it didn’t work, I debug my theme but no error.

The Reference on css-tricks can be taken into consideration if (and only if) you need it for a custom project. As soon as it gets to stock items that is a pretty different game.

You have probably a bunch of issues with your javascript but as I described above that’s the way to go. First remove those 2 lines and load the default jquery, and if it still get stuck then you should inspect all plugins. Starting with deactivating all Wordpress Plugins you have installed (if you have some installed), and ending with the jquery plugins you have included into your theme. Do not only remove the lines where you load the javascript files but you also need to remove the lines which executes this particular file, because this can also cause some issues.

infuse01 said
The Reference on css-tricks can be taken into consideration if (and only if) you need it for a custom project. As soon as it gets to stock items that is a pretty different game.

You have probably a bunch of issues with your javascript but as I described above that’s the way to go. First remove those 2 lines and load the default jquery, and if it still get stuck then you should inspect all plugins. Starting with deactivating all Wordpress Plugins you have installed (if you have some installed), and ending with the jquery plugins you have included into your theme. Do not only remove the lines where you load the javascript files but you also need to remove the lines which executes this particular file, because this can also cause some issues.

I didn’t use any plugin and not issue with my js, I didn’t understand we use wp_deregister_script(‘jquery’); to De-registers the WordPress stock jquery script, so we can register our own copy or from the Google CDN right? why we can’t use this.

because it’s a rule, a guide. It’s there to mainstream the development process for plugin and theme developers. If everyone uses another version there would be massive problems with compatibility.

You want to use the newest version of jquery because one of the plugins you’re using requires it. But if your client downloads your theme and tries to use a wordpress plugin which relies on the standard jquery version from WP, there would be many problems and you have more work because people complaining and want their money back and so on. So simply stick with the Wordpress Default and arrange everything at it.

infuse01 said
because it’s a rule, a guide. It’s there to mainstream the development process for plugin and theme developers. If everyone uses another version there would be massive problems with compatibility.

You want to use the newest version of jquery because one of the plugins you’re using requires it. But if your client downloads your theme and tries to use a wordpress plugin which relies on the standard jquery version from WP, there would be many problems and you have more work because people complaining and want their money back and so on. So simply stick with the Wordpress Default and arrange everything at it.

Thank you for your clear answer , I will use Wordpress Default then see if it works or not.

Post Reply

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody