want to know who is login in my wordpress website if admin login then go to dashboard and if user login then go to homepage 

Approach:
I used this code 

```
<?php if ( is_user_logged_in() ) {

   echo ‘ user is loin ‘ ;

} else {

 echo ‘ Not Login ‘ ;

} ?>

```

and 

```
if(is_admin()) { ...output my admin stuff....}

```

but doesn't work. any help would be extremely appreciate.