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/”>’;
else
echo get_settings(‘home’).’/”>’;
bloginfo(‘description’); ?>
</a>

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

Print Friendly

About Dave Smith

Did you know that with Twenty Ten if you fill in the User Biographical info field it will put an author window at the end of each post. Be sure to get your gravatar for all authors on your site. And fill out the Bio field in the profile.
This entry was posted in How To and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

* Copy this password:

* Type or paste password here:

5,087 Spam Comments Blocked so far by Spam Free Wordpress

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

CommentLuv badge