Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
Did you check to see whether the issue persists on another theme, like Twenty Eleven?
Thanks for the reply. I just checked and it does work on 2011. Maybe updating the theme will work. I’ll let you know the result.
It looks like the problem is my child theme — which is baffling to me, because it was working before, and just stopped out of the blue when I updated the plugins. When I revert to the original Flexible theme, the dropdowns are working. My guess is that it’s something to do with the version of JQuery I registered in functions.php — which sucks because if I have to use an earlier version of JQuery, I can’t use the tooltip I wanted to. I’m going to fiddle around for a bit and post here with the results. I’d really like to be able to use the latest JQuery.
If anyone has any idea what CAUSED this, I’d really like to know.
Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
You ought to let your theme’s vendors know of this issue.
Thanks. I’ve posted all of this information on their support forums, so they are aware. I’m just hoping the problem is what I think it is, and that I can figure out a way to use the tooltips I wanted.
Ok, I fixed it by downgrading to JQuery 1.8.3 in my functions.php, which luckily still lets me use the latest version of JQuery UI and allows me to have the Accoridions and Tooltips that I want — or at least, no troubles so far. I have activated all my plugins including W3 Total Cache and Bad Behavior and Contact Form 7, and everything seems to be in working order.
Here’s what I don’t get: why was everything working fine with the latest JQuery until I updated my plugins? Anyone have any idea?
I sincerely hope that you are not de-registering core jQuery.
Sounds like that could be drastically bad, in your opinion. Please explain.
It’s about as bad as you can get. If you de-register core jQuery, part of the WordPress admin UI will either break or will start to behave unpredictable. Plugins that rely on core jQuery will also no longer work correctly. Put it this way – de-registering core jQuery is absolutely forbidden in WPORG themes and by many commercial theme providers
I used
if( !is_admin() ){
So it doesn’t affect the admin UI. What plugins are we talking about here? I need to deregister it or I can’t use the JQuery UI functions I want.
What plugins are we talking about here?
Impossible to say. Make a list and use a pin to select one. Seriously – just about any plugin can rely on core jQuery. And using !is_admin() is no protection against those parts of core that also rely on jQuery.
Do yourself a favour – do not de-register core jQuery – ever. I’ve seen this create all kinds of problems on sites. so much so that I even blogged about it last year.
Ok. I believe you. I haven’t run into any problems yet, but I guess that doesn’t mean I won’t. Let me see what JQuery UI feature will still work if I use the core.
Thanks for taking the time to help me learn. I really appreciate it. I guess using the core does work just fine. The tooltip even works. The problem before when I did it was that I was adding the effects I wanted individually, but I just had to add jquery and jquery ui.
Wait — scratch that. It doesn’t work at all.
Ok, so what am I missing here?
This doesn’t work:
function my_scripts_method() {
wp_enqueue_script('jquery');
wp_enqueue_script('jquery-ui-core');
}
add_action('wp_enqueue_scripts', 'my_scripts_method');
(That or if I add the effects individually)
But this does work:
if( !is_admin() ){
wp_deregister_script('jquery');
wp_register_script('jquery', ("http://code.jquery.com/jquery-1.8.3.min.js"), false, '');
wp_enqueue_script('jquery');
}
if( !is_admin() ){
wp_deregister_script('jquery_ui_core');
wp_register_script('jquery_ui', ("http://code.jquery.com/ui/1.10.2/jquery-ui.min.js"), false, '');
wp_enqueue_script('jquery_ui');
wp_enqueue_style ('excite-bike', ("http://code.jquery.com/ui/1.10.2/themes/excite-bike/jquery-ui.min.css"), false, null);
}
Obviously I’d rather do it the right way, and I understand what you’re saying about using the core, but until I can figure it out, I’m going to have to stick with the way that has been working. Any help is appreciated. Is my code wrong? What’s the deal?