Posts form with AJAX request – Plugin development

Post without AJAX is working perfectly fine, but with AJAX, it’s returning 0. Simply put, that’s because your AJAX request doesn’t include the pp_submit input which is required by pp_html_process() — the callback for both regular and AJAX form submission. I.e. As I said in the comments: jQuery doesn’t serialize submit button value (see here), … Read more

shortcode // get posts by ids

If you have no problem with using this shortcode [posts id=”1,2,3,4″], the only thing left for you to do is create an array from the id attribute and loop it, like this. add_shortcode( ‘posts’, ‘posts_shortcode’ ); function posts_shortcode($atts) { $atts = shortcode_atts( array( ‘id’ => ” ), $atts ); $HTML = ‘<div class=”posts”>’; foreach (explode(‘,’, … Read more