To check whether a user is an admin, use ( current_user_can( 'manage_options' ) )
.
Then you can enqueue your css file that changes the nav position accordingly in your functions.php
:
add_action ( 'wp_enqueue_scripts', 'ic_admin_navbar_frontend_css' );
function ic_admin_navbar_frontend_css() {
if( current_user_can( 'manage_options' ) && ! is_admin() ) { // we don't want to load this on the admin side, just the front end
wp_enqueue_style( 'ic-navbar-fix', get_stylesheet_directory_uri() . '/pathtofile/in/templatedirectory/my_special.css' );
} // end check for admin user on frontend
} // end ic_navbar function
Hope that helps.
EDIT: Sorry, I misread the question... To check whether someone is logged in, admin or not, you can use is_user_logged_in()
. Just replace current_user_can()
above and you should be good to go.