Take Me to The Dashboard

Here is a really nice piece of code that I ran into on a theme I’ve been modifying. If you are logged into the blog and you are an Admin you click on the description and it takes you directly to the admin panel. If you are anyone else it takes you “home”.

You put this in the header.php file where the description is currently called.

I know you can add the Admin widget to the sidebar to quickly get there, but I think it looks unkempt. I don’t like seeing those login sections out in the open for the general public to see. It simply doesn’t compliment the presentation of your blog or the content. But this little gem makes it easy to get to the admin screen.

<a href=”<?php
if (current_user_can(‘level_10’))
echo get_settings(‘home’).’/wp-admin/”>’;
echo get_settings(‘home’).’/”>’;
bloginfo(‘description’); ?>

Not much to it, but a really nice way to navigate back and forth.