我想你最好看看奥托关于评论形式和功能的帖子,这里:http://ottopress.com/2010/wordpress-3-0-theme-tip-the-comment-form/
如果要切入主题,可以将此函数添加到函数中。php:
function my_fields($fields) {
$fields[\'new\'] = \'<p>Some new input field here</p>\';
return $fields;
}
add_filter(\'comment_form_default_fields\',\'my_fields\');
然后设置新的默认值,根据需要更改HTML和类/ID:
$defaults = array(
\'fields\' => apply_filters( \'comment_form_default_fields\', $fields ),
\'comment_field\' => \'<p class="comment-form-comment">...\',
\'must_log_in\' => \'<p class="must-log-in">...\',
\'logged_in_as\' => \'<p class="logged-in-as">...\',
\'comment_notes_before\' => \'<p class="comment-notes">...\',
\'comment_notes_after\' => \'<dl class="form-allowed-tags">...\',
\'id_form\' => \'commentform\',
\'id_submit\' => \'submit\',
\'title_reply\' => __( \'Leave a Reply\' ),
\'title_reply_to\' => __( \'Leave a Reply to %s\' ),
\'cancel_reply_link\' => __( \'Cancel reply\' ),
\'label_submit\' => __( \'Post Comment\' ),
);
在这种情况下,我不确定您是否可以将类或ID直接应用于“取消回复链接”。你可以试着用
<span>
在此处标记,或者使用一些有创意的javascript找到它并应用一个类:
$(\'a:contains("Cancel Reply")\').addClass(\'cancel-reply-link\');