我在WORDPRESS中使用COMMMENT FORM,但我想自定义表单。默认情况下,该表单已包装:
<div id="respond" class="comment-respond">
...
</div>
现在我想在标签中添加一些类属性。那么我可以使用过滤器挂钩使它成为一个好主意吗?谢谢
答案 0 :(得分:0)
这是文件comments.php的代码:
<div class="wilpost-component__module mb-30">
<?php if (have_comments() == false) { ?>
<h3 class="postComponent-title">No comment</h3>
<?php } else { ?>
<h3 class="postComponent-title"><?php echo esc_html("(" . get_comments_number() . ")comment"); ?></h3>
<div class="wilpost-comment__module">
<ol class="commentlist">
<?php
wp_list_comments(array('callback' => 'fractal_comment', "style" => "ol"));
?>
</ol>
</div>
<?php } ?>
</div>
<?php comment_form();?>
这是我想要自定义我的注释形式的代码:
<div class="wilform__module wilform__feedback">
<form name="wil-feedback" id="wil-feedback" action="#">
<div class="item-group">
<label for="name">name</label>
<input type="text" id="name"/>
<div class="form-icon"><i class="fa fa-user"></i></div>
</div>
<div class="item-group">
<label for="email">email</label>
<input type="email" id="email"/>
<div class="form-icon"><i class="fa fa-envelope"></i></div>
</div>
<div class="item-group">
<label for="textarea">textarea</label>
<textarea></textarea>
</div>
<button class="wil-btn wil-btn--primary wil-btn--md wil-btn--round " type="submit">Subscrible<i class="la la-paper-plane"></i>
</button>
</form>
</div>