![](/img/trans.png)
[英]With two comment boxes, how to suppress comments in one of them in Wordpress?
[英]Remove boxes from wordpress comments
我希望有人可以幫助我,或指出我正確的方向。 我正在把頭發拉出來。
關於wordpress評論表。 我有這些盒子:
我查看了wordpress函數頁面: https : //codex.wordpress.org/Function_Reference/comment_form ,其中提到了這個'comment_notes_before'=>'' - 即使我將值設為空白,它仍會添加那些血腥的盒子!
有人可以告訴我如何刪除它們嗎?
ps我使用的是標准的comment_form($ comments_args); 實現不是自定義表單。
謝謝
編輯:完整代碼
<?php
$fields = array(
// author field
'author' => '',
//email field
'email' => '',
'comment_notes_before' => '',
'comment_notes_after' => ''
);
?>
<?php
$comments_args = array(
'id_form' => 'commentform',
'class_form' => 'comment-form',
'id_submit' => 'submit',
'class_submit' => 'submit',
'name_submit' => 'submit',
'title_reply' => __( 'Leave a Reply' ),
'title_reply_to' => __( 'Leave a Reply to %s' ),
'cancel_reply_link' => __( 'Cancel Reply' ),
'label_submit' => __( 'Post Comment' ),
'format' => 'xhtml',
'comment_field' => '<p class="comment-form-comment"><label for="comment">Comment</label><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true">' .
'</textarea></p>',
'must_log_in' => '<p class="must-log-in">' .
sprintf(
__( 'You must be <a href="%s">logged in</a> to post a comment.' ),
wp_login_url( apply_filters( 'the_permalink', get_permalink() ) )
) . '</p>',
'logged_in_as' => '<p class="logged-in-as">' .
sprintf(
__( 'Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out?</a>' ),
admin_url( 'profile.php' ),
$user_identity,
wp_logout_url( apply_filters( 'the_permalink', get_permalink( ) ) )
) . '</p>',
'fields' => apply_filters( 'comment_form_default_fields', $fields ),
);
?>
使用CSS選擇器來設置注釋區域的樣式絕對是最好的方法,因為沒有WordPress鈎子來控制它。
我快速查看了文檔,我看不到你刪除按鈕的位置,如果它與文本編輯器設置相同,它們是用js添加的,但是你可以使用css並將它們設置為display:none快速解決方案。 - 大衛 2015年12月16日1:18
大衛有正確的想法,看起來就是這樣做的。 在掃描我之前的評論之前 - CSS!
我正在回答這個問題,因此它不再顯示為無人接聽。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.