Change Comment Form Title

User
comment_form() wordpress change form title
Assistant
To change the **form title** (usually "Leave a Reply") when using `comment_form()` in WordPress, you can pass a custom array to override the default arguments. Specifically, you should modify the `title_reply` parameter.

### βœ… Example:

<?php
comment_form([
    'title_reply' => 'Share Your Thoughts',
]);
?>

### πŸ”„ Other Useful Parameters You Can Customize:
– `'title_reply_to'` – Title when replying to a specific comment.
– `'cancel_reply_link'` – Text for the cancel reply link.
– `'label_submit'` – Text for the submit button.

### πŸ”§ Full Example:

<?php
comment_form([
    'title_reply' => 'Leave a Comment',
    'title_reply_to' => 'Replying to %s',
    'cancel_reply_link' => 'Cancel Reply',
    'label_submit' => 'Post Comment',
]);
?>

Let me know if you also want to style or conditionally change the title based on post type or other logic.

User
HIde text area label
Assistant
To **hide the label for the textarea** in `comment_form()`, you can do it in two ways:

### βœ… **Option 1: Override the `comment_field` argument**

<?php
comment_form([
    'comment_field' => '<p class="comment-form-comment"><textarea id="comment" name="comment" cols="45" rows="8" required="required" placeholder="Write your comment here..."></textarea></p>',
]);

This completely removes the label and optionally adds a `placeholder`.

### βœ… **Option 2: Use CSS to hide the label**

If you don’t want to change PHP, you can hide it via CSS:

.comment-form-comment label {
    display: none;
}

### πŸ“ Note:
– Make sure `required="required"` is kept in the “ if you remove the label.
– Using `placeholder` helps preserve accessibility to some extent.

Let me know if you want to customize other fields too (like name, email, etc.).

Leave a Comment

Your email address will not be published. Required fields are marked *