Jquery NoConflict Problem

Try and call method `prettyPhoto’ when DOM is ready, replace your code: jQuery.noConflict() jQuery(function(){ jQuery(“a[rel^=’prettyPhoto’]”).prettyPhoto(); }); with this: jQuery(document).ready(function($) { $(“a[rel^=’prettyPhoto’]”).prettyPhoto(); }); 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

How do I Import / Upload Files with jQuery AJAX?

I haven’t tried but i think you need to add FormData object directly as data parameter. Something like this var ajaxData = new FormData(); ajaxData.append( ‘action’, ‘ajax_handler_import’ ); ajaxData.append( ‘_ajax_nonce’, importNonce ); // or maybe skip the nonce for now jQuery.each($(‘#fileImportData’)[0].files, function(i, file) { ajaxData.append(‘file-‘+i, file); }); The rest of your code goes as it … Read more

Add a jQuery Function

First, don’t unregister and reregister jQuery. There’s no reason to do that at all. Second, you’re enqueuing on the wrong hook. Instead, use this in your functions file: // Enqueue Scripts function wpse78227_enqueue_scripts() { wp_enqueue_script( ‘jquery’ ); } add_action( ‘wp_enqueue_scripts’, ‘wpse78227_enqueue_scripts’ ); Now, to include that script you need to do a couple of things. … Read more

Jquery plugin not working on single pages

Your Theme is enqueueing jQuery 1.7.2: <script type=”text/javascript” src=”http://dayfun.ir/wp-content/themes/Sparks/lib/js/jquery.min.1.7.2.js”></script> And WordPress is enqueueing jQuery 1.8.3: <script type=”text/javascript” src=”http://dayfun.ir/wp-includes/js/jquery/jquery.js?ver=1.8.3″></script> See also, Frank’s answer regarding jQuery no-conflict mode. Edit WordPress bundles a version of jQuery. You will inevitably encounter problems if your Theme (or a Plugin) enqueues a separate version of jQuery – whether by enqueueing that … Read more

Stop WordPress processing Javascript as text

The post editor is really not meant for inserting functional code like JavaScript into the page. Anything you put through the post editor will get run through wpautop() before output, which is what adds the paragraph tags — even if you enter it via the Text mode. I’d suggest outputting your JavaScript via a hook … Read more