I would like to display content to a certains kind of user (some of them custom) if they are logged-in.
Is there a way to associate :
if( is_user_logged_in() && ($user_role != "Administrator" && $user_role != "customrole") ):
// display content
else:
// redirect back to other page
wp_redirect( 'https://customurl.com' );
exit;
endif;
But when I try thsio code I have a fatal error. What do I do wrong please ?
Best regards,
Clément
2
Answers
Finally it was a mix, I used permission and a custom field if I want some part accessible to everyone :
if you wanna use multiple conditions you have to remove the () afther your && in the if statement and try it like this