非表示にした場合に、非公開って表示されますが、
この非公開の文字を消す方法がありますので、メモしておきます。
テーマのfunctions.php
に、以下のコードを挿入すれば、OKです。
この場合は、固定ページに適用されます。
<?php function remove_page_title_prefix( $title = ” ) { if ( empty( $title ) || !is_page() ) return $title; $search[0] = ‘/^’ . str_replace(‘%s’, ‘(.*)’, preg_quote(__(‘Protected: %s’), ‘/’ )) . ‘$/'; $search[1] = ‘/^’ . str_replace(‘%s’, ‘(.*)’, preg_quote(__(‘Private: %s’), ‘/’ )) . ‘$/'; return preg_replace( $search, ‘$1′, $title ); } add_filter( ‘the_title’, ‘remove_page_title_prefix’ ); ?>
投稿ページに適用する場合は、
[php gutter=”true” firstline=”1″]if ( empty( $title ) || !is_page() ) return $title;[/php]
の部分を、
[php gutter=”true” firstline=”1″]if ( empty( $title ) ) return $title;[/php]
に変更すれば、OKです。