Support » Fixing WordPress » show something in the sidebar only for certain users

  • What’s the code I should use to check if a user has a specific role to show something in the sidebar only for certain users?

    I want to show some links in my sidebar only for administrators…

Viewing 1 replies (of 1 total)
  • The user level (global var $user_level) should be available, so you can try testing on it:

    <?php
    global $user_level;
    if( 10 == $user_level ) :
    ?>
    <p>Hello Admin!</p>
    <?php endif; ?>

Viewing 1 replies (of 1 total)
  • The topic ‘show something in the sidebar only for certain users’ is closed to new replies.