我有以下代码来显示注释,但显示的是两个文本区域,而不仅仅是一个。
这是我的密码
<?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); ?>
对可能出现的问题有什么建议吗?
最合适的回答,由SO网友:Laniakea 整理而成
我找到了两个文本区域出现的原因:
这个comment_field
不应该在\'fields\'
数组,因为它是comment_form()
作用它应该是:
\'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