Comment Form Modifications
-
Hi Textbook Community,
I am trying to Make only NAME field Mandatory in my comment section of the posts. And somehow I managed to do that by adding following piece of code in my functions.php file
function require_comment_name($fields) { if ($fields['comment_author'] == '') wp_die('Error: please enter a valid name.'); return $fields; } add_filter('preprocess_comment', 'require_comment_name');
But there are two problems which I am not able to resolve :-
1- The Validation Result is shown after Posting the comment. While I want it to happen in such a way that I should not be able to Post comment without filling the NAME field (similar to COMMENT text area)
2- I should be able to show “Required” Text in the Name Field Area.Any help in this will be much appreciated !
The page I need help with: [log in to see the link]
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Comment Form Modifications’ is closed to new replies.