2017-12-26 1264 views
0

著者を追加してコメントフォームに電子メールフィールドを追加しようとしていますが、コメントフォームは変更されません。コメントフィールドと送信ボタンだけを持つデフォルトのテンプレートを常に表示しています。WordPressのコメントフォームを変更できません

これはキャッシングの問題か、コメントフォームテンプレートを別のディレクトリから読み込んでいますか?

私は私のページテンプレートにこのコードを使用しています:

$comments_args = array(
    'label_submit' => __('コメント送信'), 
    'title_reply' => __('コメント登録'), 
    'fields' => apply_filters('comment_form_default_fields', array(
    'author' => 
    '<p class="comment-form-author">'. 
    '<input id="author" class="blog-form-input" placeholder="Your Name* " name="author" type="text" value="'.esc_attr($commenter['comment_author']). 
    '" size="30"'.$aria_req. 
    ' /></p>', 
    'email' => 
    '<p class="comment-form-email">'. 
    '<input id="email" class="blog-form-input" placeholder="Your Email Address* " name="email" type="text" value="'.esc_attr($commenter['comment_author_email']). 
    '" size="30"'.$aria_req. 
    ' /></p>', 
)), 
    'comment_notes_after' => '', 
    'comment_field' => '<p class="comment-form-comment"><label for="comment">'._x('Comment', 'noun'). 
    '</label><br /><textarea id="comment" name="comment" aria-required="true" cols="75"></textarea></p>', 
); 
comment_form($comments_args); 
+0

がcomment_form_default_fields' '上のフィルタであるあなたのテーマや任意の場所で使用されているため、この作品を期待可能性がありプラグイン? – janh

+0

「comment_form_default_fields」を削除しても他のプラグインやテーマは使用されていませんが、まだフォームに変更はありません –

答えて

0
<?php 
$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' => '', 

); 

comment_form($comment_args); ?> 

私はあなた

+0

作成者とメールのフィールドはまだ表示されていません。私はまだ1つのフィールド(コメントフィールド)だけで、同じフォームをページに表示します。私も著者と電子メールのフィールドを参照することを期待しています –

+0

私はあなたがどのプロジェクトで使用したテーマを知っているかもしれません –

+0

どのように違いを生み出すのでしょうか? –

関連する問題