jQuery plugin function is not a function

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.

Read More

Please help, and thank you in advance for help and advice!

Related posts

Leave a Reply

1 comment

  1. 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 (see wp-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 for jQuery is not available, so you can still use:

    jQuery(document).ready(function(){
        jQuery(#somefunction) ...
    });
    

    but the following will either throw an error, or use the $ shortcut as assigned by other library.

    $(document).ready(function(){
         $(#somefunction) ...
    });
    

    However, if you really like the short $ instead of jQuery, you can use the following wrapper around your code:

    jQuery(document).ready(function($) {
        // Inside of this function, $() will work as an alias for jQuery()
        // and other libraries also using $ will not be accessible under this shortcut
    });
    

    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:

    (function($) {
        // Inside of this function, $() will work as an alias for jQuery()
        // and other libraries also using $ will not be accessible under this shortcut
    })(jQuery);
    

    Alternatively, you can always reassign jQuery to another shortcut of your choice and leave the $ shorcut to other libraries:

    var $j = jQuery;