---- comments.php を変更する ---- wp_list_comments();←カッコの中にいろいろ入っている可能性もありますが・・・ の部分を下記に更新 wp_list_comments( array( 'callback' => 'mytheme_comment' ) ); ---- function.php に追加 (最終行からで可) ---- // コメントカスタマイズ add_action( 'comment_form_field_comment', 'add_title_comment_field' ); function add_title_comment_field( $defaults ) { $defaults = '

'; $defaults .= '

'; return $defaults; } // 追加項目保存 add_action( 'comment_post', 'save_custom_comment_field' ); add_action( 'edit_comment', 'save_custom_comment_field' ); function save_custom_comment_field( $comment_id ) { if ( !$comment = get_comment( $comment_id ) ) return false; do_action('comment_form', $post->ID); $custom_key_comment_title = 'comtitle'; $get_comment_title = esc_attr( $_POST[$custom_key_comment_title] ); if ( '' == get_comment_meta( $comment_id, $custom_key_comment_title ) ) { add_comment_meta( $comment_id, $custom_key_comment_title, $get_comment_title, true ); } else if ( $get_comment_title != get_comment_meta( $comment_id, $custom_key_comment_title ) ) { update_comment_meta( $comment_id, $custom_key_comment_title, $get_comment_title ); } else if ( '' == $get_comment_title ) { delete_comment_meta( $comment_id, $custom_key_comment_title ); } return false; } // コメント記入欄 add_action( 'add_meta_boxes_comment', 'add_title_comment_field_box' ); function add_title_comment_field_box() { global $comment; $comment_ID = $comment->comment_ID; $custom_key = 'post_reviews_date' ; $custom_key_comment_title = 'comtitle' ; $noncename = $custom_key . '_noncename' ; $get_comment_title = esc_attr( get_comment_meta( $comment_ID, $custom_key_comment_title, true ) ); echo '' . "\n"; echo '

' . "\n"; } function mytheme_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; $comment_ID = $comment->comment_ID; $get_comment_title = esc_attr( get_comment_meta( $comment->comment_ID, 'comtitle', true ) ); ?>
  • id="li-comment-">
    ' ); ?> %s'), get_comment_author_link()) ?>
    comment_approved == '0') : ?>

    $depth, 'max_depth' => $args['max_depth']))) ?>