• I’m working on a widget that I need to show to logged in users only. I see the code:

    <?php
    if ( is_user_logged_in() ) {
    	echo 'Welcome, registered user!';
    } else {
    	echo 'Welcome, visitor!';
    }
    ?>

    How do I use this to display the widget for logged in users. In other words what part of the code goes into ” Welcome, registered user! ” and what goes after the else statement?

  • The topic ‘is_user_logged_in usage’ is closed to new replies.