1. If you are logged out you will see “Please log in or Register”
else if you are logged in
2. you will see “Welcome USERNAME”
<?php if (is_user_logged_in()) {
$user = wp_get_current_user();
echo 'Welcome <strong>'.$user->display_name.'</strong> !';
} else { ?>
Please <strong><?php wp_loginout(); ?></strong>
or <a href="<?php echo get_option('home'); ?>/wp-login.php?action=register"><strong>Register</strong></a>
<?php } ?>
Thanks! works like a charm
Thanks a lot, works great. Had to use ” and some  -s but that’s minor
thanks from colombia .. you code works great.!!
Been looking for this for ages thanks a million!