The hook you’re using is correct, however, you don’t need to bloat it out so much. This simpler version will do exactly what you’re looking for, with much less lines.
function wpse172052_comment_form_before_fields() {
echo '<div class="row">';
}
add_action('comment_form_before_fields', 'wpse172052_comment_form_before_fields');
function wpse172052_comment_form_after_fields() {
echo '</div>';
}
add_action('comment_form_after_fields', 'wpse172052_comment_form_after_fields');
Related Posts:
- Add option to disable comments on a per posts basis?
- Paginate result set from $wpdb->get_results()
- Change Comment Author Display Name
- How to allow the reply link to remain on the comment form after I have reached my 10 nested comment limit?
- Threaded comments – deleting parent comment leads to orphan comments
- How to remove commenters ability to add hyperlinks to comments?
- How can I edit the email sent when a new comment is received?
- How to remove or replace the log-in link for comment replies?
- How to Block Access to Standard Login Flow and Comment Flow
- Add Comment Custom Field
- Remove link preview in discussion dashboard
- Can’t add default comments to custom post type
- Does Akismet plugin expose any hooks, functions, class that can work with custom code?
- Comments Feed & Custom Post Statuses
- Multiple Comment Forms in a single page [closed]
- Displaying comments with a walker: how to distinguish between parent and child comments
- Count parent comments & replies separately?
- How to modify comments form using comment_form()?
- Capability for allowing user to post own comments without moderation
- Comment count wrong with orphaned comments
- Comment form problem with comment_author_url and HTML5 input placeholders
- How would I count the number of times a comment meta field’s value is in a post’s entire comments?
- Get comment content by comment ID
- stackexchange-like submit comment window
- Retrieve comments from current post using SQL
- Display recent comments with gravatar and excerpts?
- Cannot get local avatars to show [closed]
- Limit user to one comment
- Is comment metadata included in the export file?
- Get a List of All Commenters on the Current Post
- WordPress comments on users profile
- wordpress threaded comments – customize nested ul / how child ul is displayd
- How to make a secure blog that is completely private?
- identify and delete spam comments from 3000 pending comments
- Hide comments column in WordPress backend
- Removing the limit on the number of nested comments
- How to call my custom WordPress Comment form without getting the comments?
- Auto delete comment if Contains
- How would I add the comment count to this sub-pages of current page snippet
- How can I test why the comment hook is not working?
- How do i remove “Website” field from WordPress comments
- Placed on + only date (not time)
- Loading Comments From a Class?
- WordPress comments work locally only?
- comment reply by email
- have_comments not true for logged out visitors?
- “Discussion” checkboxes unchecked by default on pages? [duplicate]
- How to disable or hide WordPress.com as a social media login option for Jetpack Comments [closed]
- How to limit comment indentations to one level?
- Anonymize comments after one year
- Minimum allowed comment length only on a specific page
- How can get comment id from comment link?
- How can I count only guests comments?
- Comment System showing different type of IP
- Pending Comments
- Only Allow post author and “Premium” Role user to comment
- Anonymous spam comments when only registered users can comment
- Exclude the word comment from being referenced
- How to open up comments to all visitors
- get only one last comment from each post
- Limit action in comment according to IP
- How to get recent comment link
- stumped on add_action hook to delete_comment – any ideas?
- Can I create a new comment type?
- Avoiding calls to theme-compat
- Allow tags between shortcode in comments
- How / where is the wp_query object created for RSS feeds?
- Separate page for comments using permalinks and add_rewrite_rule
- Return count for characters in the comment and perform action based on the length
- Delete/Spam Comment Button
- Who approved a comment, to show up in dashboard
- Cannot Remove Title Reply from Custom Comment Template for Signup Page
- How to make email field not required in comments?
- I have an odd field with a purple background, mentioning HTML-codes to use while leaving comments
- No comment Section but still got a Comment
- How to prevent users/authors from seing IP/email of new commentators?
- Why are my threaded comments not quite working? [closed]
- $post->comment_status always returns ‘closed’
- Order comments in admin by custom date
- WordPress Comments – Divide by conversation like Medium.com
- I want to limit registered user to 1 comment per post in WordPress
- What is wrong with this? [closed]
- Comment moderation
- Redirect first time comments
- Posting XML in comment section
- How to check if post has previous_comments_link() and next_comments_link()
- Comment text area in single blog post and show comments if approved
- Comments – Ensure the correct field is highlighted for nested replies
- How to ‘If Author’ Comments Check
- selectively disable akismet
- How to hold all comments for moderation, including author’s comments on own post
- Comment Blacklist
- WordPress error when sending comment
- WordPress Page Template: Comment Filtering with Querystring
- Modify “Recent Comments” List in WP-Admin
- Comment submission & navigation redirects to default language
- comments are going to spam
- wp_list_comments adds unnecessary elements
- How to enable truly anonymous posting in bbPress forums? [closed]
- comment_approved custom value