Post Pic

How to define your own dashboard logo

By default, the “W” WordPress logo is displayed on the top left side of the dashboard. If for some reason, you’”d like to add your own logo, just read this recipe.

The first thing to do is to get your logo ready. Size might be 30*31px and the logo must be uploaded the images directory of your theme dir.
For exemple, if you're using the rockstar theme from WooThemes, your logo must be uploaded to wp-content/themes/rockstar/images.

Once done, open you functions.php file and paste the following code in it:

add_action('admin_head', 'my_custom_logo');

function my_custom_logo() {
   echo '
      <style type="text/css">
         #header-logo { background-image: url('.get_bloginfo('template_directory').'/images/custom-logo.gif) !important; }
      </style>
   ';
}

Thanks to Smashing Magazine for this great hack!

9 Responses

Dec 18 2009 19:39

Yes, this is a great hack, particularly for clients’ sites.

Also…just wanted to point out that there’s a typo in the title of this post.

Dec 19 2009 16:34

Excellent wordpress hack! Tnx.

Dec 22 2009 14:04

Great little recipe and goes brilliantly with the change wordpress login tutorial. Thanks again :)

Jan 18 2010 10:53

Very easy and useful hacks. Thanks for sharing and special thanks for Smashing Magazine.

Jan 21 2010 19:50

If you’re looking to change more than just the logo (and not edit any files) you should really check out the Fluency Admin Plugin. It completely restyles the admin interface. After I installed it, it quickly made its way to every other WP installation I had.

http://wordpress.org/extend/plugins/fluency-admin/

Mar 16 2010 13:04

So this only works with GIF images? As if i put in a PNG it’s not showing.

Apr 19 2010 04:28

great hack, it worked just fine!

May 03 2010 03:01

Simple, Effective, Perfect!

Keep up the good work mate.

Trackbacks:

Leave a Comment

* Name, Email, Comment are Required