Skip to main content
1 of 11
Dealazer
  • 57
  • 1
  • 2

The correct answers to the above solution-question are:

As "wp_get_current_user" only is available for logged in users.

<?php if(wp_get_current_user('editor')) || (wp_get_current_user('administrator') { ?> 
<!-- Stuff here for editors or administrators -->
<?php } ?>

If you have a special plugin that gives multiple roles to users?

<?php if(wp_get_current_user('author','editor')) { ?>
<!-- Stuff here for author and editor -->
<?php } ?>

If you want to see if the current user is either editor or administrator

<?php if(wp_get_current_user('editor')) { ?>
<!-- Stuff for the editor here, at least he is identified -->
<?php } else { ?>
<?php if(wp_get_current_user('administrator')) { ?>
<!-- Stuff for the administrator here, at least he is identified -->
<?php } else { 
} ?>
Dealazer
  • 57
  • 1
  • 2