Ajax loop refresh on click
Shouldn’t be too tricky. First: create a javascript file and add this: jQuery(document).ready(function($){ $(‘#refresh-links-id’).click(function(e){ e.preventDefault(); $.post(ajaxurl,{action:’jpb_random_loop’}, function(data){ $(‘#content-inner’).fadeOut(250).empty().append( data ).fadeIn(250); }); }); }); Save that file in your theme directory somewhere (could be in a subdirectory too). For this to work, the refresh link should not be inside ul#content-inner. Pretty basic jQuery post call, though. … Read more