WordPressでは、標準で各投稿に対してコメントが出来るような仕様なのでR。
そのため、
コメントが特にいらないサイトなどでは、これをなくする必要があるのでR。
プラグインの「Disable Comment」などはその機能を果たすプラグインでR。このプラグインの記事は、ここに書いたのでR。
ただし、
テーマによっては、「Disable Comment」を使っても、”Comment are closed”や”Comment closed”などの表示があることがあるのでR。
そこで、プラグイン「Remove “Comments are closed”」などが登場するのでR。Remove “Comments are closed”の詳細は、ここにR。
これで”Comments are closed”が削除(remove)となるはずでR。
しかし、
さらに、テーマによっては”Comments closed”などが残っているのでR。例えば、テーマのChosen(https://www.competethemes.com/chosen/)では、”Comments closed”が残ったままでR。
そこで、ここにあるように、comment.phpをいじったのでR。
しかし、だめだったのでR。
そこで調べると、Chosenにはcomments-link.phpがあったので、ここをみるとソースは以下でR。
<span class="comments-link"> <i class="fa fa-comment" title="<?php _e( 'comment icon', 'chosen' ); ?>"></i> <?php if ( ! comments_open() && get_comments_number() < 1 ) : comments_number( __( 'Comments closed', 'chosen' ), __( '1 Comment', 'chosen' ), __( '% Comments', 'chosen' ) ); else : echo '<a href="' . esc_url( get_comments_link() ) . '">'; comments_number( __( 'Leave a Comment', 'chosen' ), __( '1 Comment', 'chosen' ), __( '% Comments', 'chosen' ) ); echo '</a>'; endif; ?> </span>
「ダッシュボード」→「外観」→「テーマの編集」にもcomments-link.phpがあるので、上のソースをざっくりと削除して、
<span class="comments-link"> </span>
だけにすると、”Comments closed”が消えたのでR。
たぶん、同じような構造のテーマには、有効だと思うのでR。




この記事をシェアできます。