WordPress comment submit using ajax

Please write below code in functions.php add_action(‘init’, ‘ajaxcomments_load_js’, 10);function ajaxcomments_load_js(){ wp_enqueue_script(‘ajaxcomments’, get_stylesheet_directory_uri().’/ajaxcomments.js’);} add_action(‘comment_post’, ‘ajaxify_comments’,20, 2);function ajaxify_comments($comment_ID, $comment_status){ if(!empty($_SERVER[‘HTTP_X_REQUESTED_WITH’]) && strtolower($_SERVER[‘HTTP_X_REQUESTED_WITH’])…

Continue Reading →

Posted in: PHP