[英]Wordpress change an order in comment form
我有一个这样的评论表格截图
我想在评论文本区域上方移动姓名/电子邮件输入。 我试图在谷歌上找到它,但我没有找到任何有用的东西。 我使用的是 WordPress 5.1 版
请建议实现我的目标的方法
你可以这样做
function comment_override(){
$comment_args = array('title_reply' => 'Got Something To Say:',
'fields' => apply_filters('comment_form_default_fields', array(
'author' => '<p class="comment-form-author">' . '<label for="author">' . __('Your Good Name') . '</label> ' . ($req ? '<span>*</span>' : '') .
'<input id="author" name="author" type="text" value="' . esc_attr($commenter['comment_author']) . '" size="30"' . $aria_req . ' /></p>',
'email' => '<p class="comment-form-email">' .
'<label for="email">' . __('Your Email Please') . '</label> ' .
($req ? '<span>*</span>' : '') .
'<input id="email" name="email" type="text" value="' . esc_attr($commenter['comment_author_email']) . '" size="30"' . $aria_req . ' />' . '</p>',
'url' => '')),
'comment_field' => '<p>' .
'<label for="comment">' . __('Let us know what you have to say:') . '</label>' .
'<textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea>' .
'</p>',
'comment_notes_after' => '',
);
return comment_form($comment_args);
}
remove_action('comments_template');
add_action('comments_template', 'comment_override');
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.