display user input using ajax in wordpress

I don’t have enough reputation to comment. Try giving the datatype to the ajax call maybe this is due to json error. Try adding datatype in your ajax as html for testing, then you can get into working path from these $.ajax({ type: ‘POST’, url: ajaxurl, dataType: “html”, data:{“action”:’InsertIntoDB’,message:text}, success:function(msg){ alert(msg); } Also just try … Read more

jQuery AJAX add json2 dependency?

You don’t have to manually handle dependencies. That is the whole point of the enqueue system, it handles dependencies for you. There’s nothing wrong with the code in your post, so if you want help on it, you’ll need to ask about your problem more specifically.

setup_postdata in “loop-handling” php file called via $.ajax

Solved by getting author, post_date, permalink & excerpt manually without setup_postdata: $excerpt = myCustomExcerptFunction($post, 35); $post->post_excerpt = $excerpt; // Permalinks $post->post_permalink = get_post_permalink($post->ID); // Author $authorObjekt = get_userdata($post->post_author); $post->post_author_displayname = $authorObjekt->data->display_name; $post->post_author_nicename = $authorObjekt->data->user_nicename; // Date $post->post_date_wpformat = date_i18n( get_option( ‘date_format’ ),