wordpressの固定ページでテンプレートページを使用した場合のパスワード保護方法
- 公開日:
- 更新日:
- 文字数:478文字
<?php
/*
Template Name: Sample
*/
?>
<?php if( !post_password_required( $post->ID ) ) : ?>
<?php get_header(); ?>
<!-- content-wrap -->
<div id="content-wrap">
<!-- content-area -->
<div id="content-area">
</div>
<!-- /content-area -->
</div>
<!-- /content-wrap -->
<?php get_footer(); ?>
<?php else: ?>
<?php echo get_the_password_form(); ?>
<?php endif; ?>
