strange conditional tag behaviour [duplicate]
In the first version of your code, you don’t check if user is logged in. In the second attempt your logic is wrong, I guess. So your code should look like so: <?php // If CPT and not logged in, display a message: if ( ‘CPT’ == get_post_type() && !is_user_logged_in() ) { echo ‘<p class=”must-log-in” … Read more