I’m having a problem I’ve never seen before. In a very new WordPress install, I uploaded a theme I had been working on for a friend’s restaurant: CornerPocketPub.com
The problem, as you can see, is that the jquery plugins for the homepage (.cycle) and the menu page (.easyAccordion) aren’t being recognized as functions in Firebug. Now, I’ve been looking all around for answers, but I can’t seem to get a solution that works for me.
Please help, and thank you in advance for help and advice!
I still say this is a jQuery issue; however, it is important to note that WordPress requires no-conflict mode for jQuery.
From Codex: jQuery noConflict Wrappers
The jQuery library included with WordPress is set to the
noConflict()
mode (seewp-includes/js/jquery/jquery.js
). This is to prevent compatibility problems with other JavaScript libraries that WordPress can link.In the
noConflict()
mode, the global$
shortcut forjQuery
is not available, so you can still use:but the following will either throw an error, or use the
$
shortcut as assigned by other library.However, if you really like the short
$
instead ofjQuery
, you can use the following wrapper around your code:That wrapper will cause your code to be executed when the DOM is fully constructed. If, for some reason, you want your code to execute immediately instead of waiting for the DOM ready event, then you can use this wrapper method instead:
Alternatively, you can always reassign
jQuery
to another shortcut of your choice and leave the$
shorcut to other libraries: