WordPress.org

Forums

Widget & Dynamic sidebar - can I do this? (2 posts)

  1. JMershon
    Member
    Posted 8 years ago #

    Currently I have a dynamic sidebar - visitors get one sidebar, logged in users get a different one. This is done via the code that follows. Can I add widgets to the logged-in user version and not the Guest version? How would I do that?

    <?php
    
    global $user_login, $user_identity;
    get_currentuserinfo();
    if ($user_login) :
    ?>
    <h2>Welcome back<br><?php echo $user_identity; ?>!</h2>
    
    <?php else : ?>
    
    <li><h2>Welcome Guest! </h2>
  2. You could use an ExecPHP widget...

Topic Closed

This topic has been closed to new replies.

About this Topic