Wordpress 更改评论表单中的顺序
Wordpress change an order in comment form
我有这样的评论表
Screenshot
我想将 name/Email 输入移动到评论文本区域上方。
我试图在 google 上找到它,但我没有找到任何有用的东西。
我正在使用 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');
我有这样的评论表 Screenshot
我想将 name/Email 输入移动到评论文本区域上方。 我试图在 google 上找到它,但我没有找到任何有用的东西。 我正在使用 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');