How to control what jQuery version to include, with wp_enqueue_script

That’s the size of the minified jQuery nowadays 🙂 You can load the latest from Google: wp_deregister_script(‘jquery’); wp_register_script(‘jquery’, (“http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js”), false, ‘1.8.2’); Please keep in mind that this can cause issues moving forward, as you are forcing WordPress to load a certain version of jQuery instead of the version bundled with it. There are plugins out … Read more

AJAX nonce with check_ajax_referer()

Difficult to say for sure where the mistake is as you have not mentioned about your add_action(‘wp_ajax_my_function’,’whatever_callback’);which I think you missed out on that. But your question is missing info in this respect. This is how I would get on about this: In your functions.php file or similar: add_action(wp_ajax_handle_login, ‘handle_login_ajax’); add_action(wp_ajax_nopriv_handle_login, ‘handle_login_ajax’); Make sure your … Read more

Ajax Load More Posts in Category Page

Your query parameters don’t contain any category arguments. You need to pass and set cat or category_name along with the post type, offset, and posts per page. You can get the current category’s ID via get_queried_object(): $queried_object = get_queried_object(); $cat_id = $queried_object->term_id; Output and retrieve the value somewhere in your category template, or better, when … Read more

How to get attachment id as soon as it is uploaded through media uploader in jquery?

You are close, you just need to hook into the add event instead of the reset event. (In case you did not know, these are standard events provided by Backbone collections. So familiarizing yourself with that will be helpful when developing things around stuff where WordPress employs Backbone.js.) So basically you’d modify your code like … Read more

What is the simplest ajax upload plugin or script to be used with wordpress?

I have used the native uploader with great results. Try adding this snippet of JS: jQuery(‘#upload_image_button’).click(function() { formfield = jQuery(‘#fwpPhoto’).attr(‘name’); tb_show(”, ‘media-upload.php?type=image&amp;TB_iframe=true’); return false; }); window.send_to_editor = function(html) { imgurl = jQuery(‘img’,html).attr(‘src’); jQuery(‘#fwpPhoto’).val(imgurl); tb_remove(); } Then, in your HTML: <input id=”fwpPhoto” name=”facultyPhoto” value=””> <input id=”upload_image_button” type=”button” value=”Upload Image”> For Multiple Uploaders <input id=”facultyPhoto-1″ name=”facultyPhoto-1″ value=”” … Read more