WordPress ajax call returns a zero though die()

When an ajax call returns 0 this usually means that you do not have your actions set up correctly. You will want to make sure that you are hooking into wp_ajax as well as wp_ajax_nopriv add_action( ‘wp_ajax_ACTION’, ‘your-callback’ ); add_action( ‘wp_ajax_nopriv_ACTION’, ‘your-callback’ ); I would guess that the problem is that you are only hooking … Read more

Change header.php after ajax call

Your best bet would be to change the body class (either add class or remove class) with jQuery after the ajax call as a callback. $.ajax({ url: “yourloop.php”, context: document.body }).done(function() { $(this).addClass(“finished-loop”); }); http://api.jquery.com/jQuery.ajax/

url – ajax loaded but no JS

Try this code in your complete callback of the load function: $(“.postbox_wrapper”).load( jQuery(this).attr(“href”) + ” .postbox_wrapper”, function(response, status, xhr) { // complete callback // create a empty div var div = document.createElement(‘div’); // fill div with response div.innerHTML = response; // take correct part of the response var ref = $($(div).find(‘.postbox_wrapper’).html()); // filter response for … Read more

Pass data back to TinyMCE from Thickbox

Okay so I spit through some existing themes I have to try and figure out how to achieve this. If anyone is reading this, this is how I did it: In the onclick function of the TinyMCE I called the ajax form and then inside the form I added some javascript that uses the tinyMCE.activeEditor.execCommand(‘mceInsertContent’, … Read more