WordPress管理画面の投稿一覧で、記事のステータス毎に背景色を色分けする方法をご紹介いたします。
WordPress管理画面の投稿一覧でステータス毎に色分けする方法
記事のステータス毎に色分けをするには、適用しているテーマのfunctions.phpに以下を追加します。
function poststatus_background_color() {
?>
<style type="text/css">
/* 公開済み */
.status-publish { background-color: #CCCCCC;}
/* 下書き */
.status-draft { background-color: #FCE3F2;}
/* 非公開 */
.status-private { background-color: #F2D46F;}
/* レビュー待ち */
.status-pending { background-color: #87C5D6;}
/* パスワード保護 */
.post-password-required { background-color: #EEEE22;}
/* 予約投稿 */
.status-future { background-color: #C6EBF5;}
</style>
<?php }
add_action( 'admin_head', 'poststatus_background_color' );
カラーコードは、それぞれ好きな色に変更してください。
あとがき
プラグインを使う場合は、Colored Admin Post Listをインストールすれば、簡単にステータス毎に記事の色分けをすることができます。

