I’ve tried my theme with the standard browser of my android mobile phone (I couldn’t check out a name. It’s just called “Browser”) and my whole jquery Code doesn’t work, even my list menu, which I use for mobile devices instead of the navigation bar.
I also tried Dolphin Browser and Boat Browser where it also doesn’t work.
But it works with Opera Mobile Browser and Firefox Mobile Browser.
Does anyone have similar experiences?
I load jquery + my jquery file (functions.js) in the functions.php with this code
But the variables don’t have a value with my mobile browser (I tried it with alert).
Any Ideas how I could fix it?
I already had problems with that PHP code in the footer.php before with IE when it was located in the header.php: The whole page was empty. That’s why I put it in the footer
Also, don’t deregister the WP copy of jQuery if building a commercial theme. I believe that is a rejection reason here, just as it is on WordPress.org.
That’s right. Always use jQuery version that is part of WordPress package or else you can cause incompatibilities with plugins. Also use wp_localize_script() for sending variables to your scripts. This way your code stays clean and you ensure that variables are placed before your script.
Also, don’t deregister the WP copy of jQuery if building a commercial theme. I believe that is a rejection reason here, just as it is on WordPress.org.
You don’t have to enqueue jQuery manually. Just mention it in the array of scripts required for your script file, WordPress will load it automatically. Also make sure that you have deleted all the code that deregisters and registers new version of jQuery.
Because it’s not needed in the dashboard.
Many themes use this. But even if I remove it, it doesn’t work
Whenever you enqueue a plugin in the functions.php, it will be outputted only in the front end. So that function is really useless…
Do you have wp_head() & wp_footer() in your theme? If WordPress is loading jQuery, it loads it in one of these two hooks and if you’re missing them you’re error is obvious…