WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. JMershon
    Member
    Posted 7 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. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    You could use an ExecPHP widget...

Topic Closed

This topic has been closed to new replies.

About this Topic