Skip to content

Instantly share code, notes, and snippets.

@patrickposner
Created January 26, 2022 15:57
Show Gist options
  • Save patrickposner/0357f305508bd37ff56b51f9a0a53355 to your computer and use it in GitHub Desktop.
Save patrickposner/0357f305508bd37ff56b51f9a0a53355 to your computer and use it in GitHub Desktop.
Protect entire singular.php template with Passster and password lists.
<?php
echo do_shortcode( '[passster password_list="115"]' );
$atts = array( 'password_list' => '115' );
$valid = passster\PS_Conditional::is_valid( $atts );
if ( $valid ) {
get_template_part( 'template-parts/content', get_post_type() );
// You can also use any other template of ACF layout here.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment