Password Protect: Custom Templates & Custom Fields

If you have a page template that does not use the standard the_content(); code or you have custom fields on the page you want to hide, you can simple add this code:

Usage:

global $post;
get_header();

if ( ! post_password_required( $post ) ) :

	// Paste page content here

else : 

	// Password form
	echo get_the_password_form();

endif;