How to activate the form for password protection

This goes into the single.php for example.

<?php
global $post;
if ( ! post_password_required( $post ) ) : ?>
//Your HTML content goes her
<?php else:
	echo get_the_password_form();
endif; ?>

Leave a Reply

Your email address will not be published. Required fields are marked *