/ Published in: PHP

Customize as needed using user roles.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php if (is_user_logged_in() ) { //only logged in user can see this ?> <div><p>You are logged in!</p></div> <?php } ?> <?php if ( current_user_can( 'delete_others_posts' ) ) { //only admins and editors can see this ?> <p>You are an admin</p> <?php } else { ?> <p>You are not an admin</p> <?php } ?>
Comments
