How to add a form to a shortcode in WordPress (using PHP and Ajax)

Recently I needed to develop a Shortcode that would display a form, this blog post details what I did. I used Ajax ( which seems the best way to add forms to shortcodes, but I’d welcome any input from other developers on your approach). So without further ado lets get on with adding a form to … Read more

How to do Ajax in WordPress

updated 10th Jan 2018 Write a javascript function to trigger the ajax call

Put js above in my_js_file.js (see later in this post). Wrap in code below for nice loading: jQuery( document ).ready(function() {    put above code here     }); To see how to send a form via ajax see here.   Write a … Read more