• Resolved sowmya

    (@sowmya002gmailcom)


    Hello,

    I am using the wordpress comments form. Please let me know how do I add some text immediately before the comment box. eg: I need to add “Please leave your comment*”. How do I achieve the same?

    Thanks for your support!
    Sowmya

Viewing 2 replies - 1 through 2 (of 2 total)
  • review:

    https://codex.www.ads-software.com/Function_Reference/comment_form

    look into comments.php to locate the function call;
    what exactly to edit where, will depend on your theme.

    for instance, to change the default ‘Leave a Reply’ above the form inputs to something else,
    try:
    <?php comment_form(array('title_reply'=>'</h3><h4 class="comment-reply-title">Add Comment or Reply </h4><h3>','fields' => array()); ?>

    to add a line just before the comment text imout, add something lke this to functions.php of your theme (will only show if the user is not logged in):

    add_filter( 'comment_form_default_fields','leave_comment_text');
    function  leave_comment_text( $text ) {
    $text[] = '<h4>Please leave your comment</h4>';
    return $text;
    }

    Thread Starter sowmya

    (@sowmya002gmailcom)

    Thanks Alchymyth

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add some text immediately before the comments box in wp comment form’ is closed to new replies.