• M. Rake

    (@moriyan-jay)


    Hi,

    I want to display a message in a plugin, if admin is logged in, and another message, if anyone else (other than admin) is logged in.
    Can someone please give me idea how to code that ?
    Thanks.

Viewing 1 replies (of 1 total)
  • widelegger

    (@widelegger)

    Here you go:

    if (is_user_logged_in() && is_admin() ){
       // here do something for the logged in admin...
    } elseif ( is_user_logged_in() ) {
       // here do something for everyone else who is logged in...
    }

    These are just a couple native WordPress functions you can use in your own code:

    http://codex.wordpress.org/Function_Reference

Viewing 1 replies (of 1 total)

The topic ‘Code something only for admin ?’ is closed to new replies.