0

I have the following code to display comments, but there are two text areas showing up, not just one.

Here is my code

<?php $comment_args = array( 'title_reply'=>'Got Something To Say:',

        $aria_req = ( $req ? " aria-required='true'" : '' ),

        'fields' => apply_filters( 'comment_form_default_fields', array(

            'author' => '<div class="grid-1-3">' . '<input id="author" placeholder="Name (required)" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' /></div>',   

            'email'  => '<div class="grid-1-3">' . '<input id="email" placeholder="E-mail (required)" name="email" type="text" value="' . esc_attr(  $commenter['comment_author_email'] ) . '" size="30"' . $aria_req . ' />'.'</div>',

            'url'    => '<div class="grid-1-3">' . '<input id="url" placeholder="Website (optional)" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" /></div>',

            'comment_field' => '<p>' . '<textarea id="comment" placeholder="Your comment here. Be cool." name="comment" cols="45" rows="8" aria-required="true"></textarea>' . '</p>',

            'comment_notes_after' => '',


        ))); // line 73


    comment_form($comment_args); ?>

Any suggestions to what the problem might be?

  • You are missing two closing brackets ) – Pieter Goosen Sep 19 '14 at 8:48
  • 1
    You should rephrase your question to be more specific to why you have two text areas as to a syntax error, and post your last update as an answer and also accept it. :-) – Pieter Goosen Sep 19 '14 at 9:10
1

I found out why the two textareas were showing up:

The comment_field is not supposed to be in the 'fields' array because it is a distinct parameter for the comment_form() function. It should be:

'url'    => '<div class="grid-1-3">' . '<input id="url" placeholder="Website (optional)" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" /></div>',

            )),

            'comment_field' => '<div class="comment-con">' . '<textarea id="comment" placeholder="Your comment here. Be cool." name="comment" cols="45" rows="8" aria-required="true"></textarea>' . '</div>',

            'comment_notes_after' => '',

        ); // line 73

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.