Logged In/Out Only Content

Webmaster WordPress Leave a Comment

Use the scripts below to show and hide content to logged in or logged out users in WordPress.

Only logged out WordPress users can see this.

<?php if (!is_user_logged_in() ) { //only logged in user can see this ?>content<?php } ?>

Only logged in WordPres users can see this.

<?php if (is_user_logged_in() ) { //only logged in user can see this ?>content<?php } ?>

Leave a Reply

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