Pop Up based on Username

Permalink
Hi all!

I am wanting to have a popup that pops up only for those who are not signed into my site. It would let them know that there are more features accessible if they sign up. I am assuming that I would need to use some code like this to get the username.
<?php
$u = new User();  
$username = $u->getUserName();
?>

What would be the best way to do this? Thanks in advance!!!

Blenderite
 
shahroq replied on at Permalink Reply
shahroq
you should just check if visitor is logged in visitor or not, and then load modal or something to notify him.
$u = new User();
if($u->isLoggedIn()) {
  //open an modal:
  //....
}
?>
JohntheFish replied on at Permalink Reply
JohntheFish

This website stores cookies on your computer. These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media. To find out more about the cookies we use, see our Privacy Policy.