i'm creating a wordpress theme and i am utilizing some scripts that use jQuery. It was working fine, until i enabled a particular plugin, named 'Paid Downloads'.

This actually made all of jquery dependencies not working anymore. So, i am thinking, that maybe i am doing something wrong. For instance, i am using prettyPhoto and initializing it like :

/* Pretty Photo */
    wp_register_style('pretty-photo-css', LIBRARIES_URI . "prettyPhoto/css/prettyPhoto.css");
    wp_register_script('jquery-pretty-photo', LIBRARIES_URI . "prettyPhoto/js/jquery.prettyPhoto.js");
    wp_enqueue_script('jquery-pretty-photo', array('jquery-my'));

jquery.prettyPhoto.js is the actual prettyPhoto file and i have just added these few lines in the end of that file, in order to trigger the prettyPhoto effect :



JQuery is enqueued like :

    wp_register_script('jquery-my', "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js");

As i mentioned, this used to work before enabling the 'Paid Downloads' plugin. I am wondering. Am i doing something wrong ? When the plugin is enabled, i get errors like that in Chrome javascript console :

Uncaught TypeError: Object [object Object] has no method 'prettyPhoto'

It seems that there is a conflict because the plugin adds jquery for its own purpose ? Any ideas ?

  • How do you enqueue jQuery in your theme?
    – Mamaduka
    Sep 2, 2011 at 12:10
  • edited my answer to reply your question
    – SpyrosP
    Sep 2, 2011 at 12:44

2 Answers 2


Try and call method `prettyPhoto' when DOM is ready, replace your code:



with this:

jQuery(document).ready(function($) {

Also 'Paid Downloads' plugins enqueues latest version of jQuery used by WordPress it's 1.6.1, it would be better if you register same version of jQuery from Google-CDN as WordPress does

  • +1 on $ vs. noConflict(); (where later is def. missing the trailing ;), but I wouldn't recommend registering jQuery from Google-CDN. Yes, it saves some server load, but def. increases loading time - Google even got a small delay before serving the reqeusted file(s).
    – kaiser
    Sep 2, 2011 at 13:22
  • Thanks, I don't like registering jQuery from Google-CDN either, but when someone does, it's better to register right version. I also like Codex approach to use plugin called Use Google Libraries
    – Mamaduka
    Sep 2, 2011 at 13:32
  • This seems to be working thanx :) I have to try it on a combination with the other plugins as well, but the prettyphoto error does not happen now, so i guess it's fine.
    – SpyrosP
    Sep 2, 2011 at 14:12
  • @Mamaduka You can change the Codex everytime. Just add or remove what you think is right. No once cares :) Btw: Hard to register the right version. Afaik you really have to know the exact path of the right version to not run into timeouts and else.
    – kaiser
    Sep 2, 2011 at 16:19

We can use like this way. Its little different. So its working separately.

var $jscript = jQuery.noConflict();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.