Check if user is logged in and do something

$require_login = get_field( 'require_logged_in' );

<?php if (! $require_login) : ?>

//Do something

<?php endif; ?>

 

<?php
if ( is_user_logged_in() ) { 
 Do something
} else {
 Do something else
}
?>

Leave a Reply

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