サポート » テーマ » 保護中の記事の抜粋文を表示

  • 保護中の記事の抜粋文を表示させようとすると
    「この投稿はパスワードで保護されているため抜粋文はありません。」
    という案内が出ます。

    保護中に抜粋文は表示できるのでしょうか?

1件の返信を表示中 - 1 - 1件目 (全1件中)
  • モデレーター jim912

    (@jim912)

    ohs70182さん、こんにちは。

    抜粋欄の入力を出すのであれば、こんな感じで。

    function enable_excerpt_password_protected_post( $output ) {
    	global $post;
    	if ( post_password_required( $post ) && has_excerpt() ) {
    		$output = $post->post_excerpt;
    	}
    	return $output;
    }
    add_filter( 'the_excerpt', 'enable_excerpt_password_protected_post', 0 );
1件の返信を表示中 - 1 - 1件目 (全1件中)
  • トピック「保護中の記事の抜粋文を表示」には新たに返信することはできません。