【发布时间】:2015-04-23 09:03:41
【问题描述】:
自定义我的评论模板,我正在使用comment_form 函数。
http://codex.wordpress.org/Function_Reference/comment_form
通过用空白值覆盖默认值来删除某些内容似乎很容易,例如表单下方的“您可以使用这些标签和属性”的文本和其他内容。但是,它不允许您从模板中删除 `cancel_reply_link',因为从数组中删除它的值仍然会使其显示为默认值。
<?php
comment_form(
array(
'comment_notes_after' => '',
'title_reply' => '',
'comment_field' => '<textarea id="comment" name="comment" aria-required="true" placeholder="Leave a comment..."></textarea>',
'logged_in_as' => '',
'cancel_reply_link' => ''
)
);
?>
如您所见,cancel_reply_link 为空,但它仍会在我的评论 textarea 之前输出以下 HTML。
<h3 id="reply-title" class="comment-reply-title">
<small>
<a rel="nofollow" id="cancel-comment-reply-link" href="/websites/wordpress/post-6/comment-page-1/#respond">Click here to cancel reply.</a>
</small>
</h3>
如何删除此h3 及其内容?
我想要删除它的原因是,当人们回复其他 cmets 时,我可以简单地在 textarea 下方的“提交”按钮旁边添加一个“取消”按钮。
谢谢。
【问题讨论】:
标签: wordpress wordpress-theming