Posted By

lromak on 10/07/10


Tagged

wordpress


Versions (?)

Who likes this?

5 people have marked this snippet as a favorite

afpilot6
tmbrenneke
jplr
bjarniolsen
jamiebrwr


How to replace the default WordPress “W” logo in the administrative header with a custom alternative


 / Published in: PHP
 

First, create an image that fits the allocated space. As of WordPress 2.8, the logo is a 30 pixels wide and 31 pixels tall transparent GIF. When using a transparent GIF or 8-bit PNG, ensure that the image matte matches the header background color: hex value 464646.

A logo named “custom_logo.gif” inside the template directory’s image subfolder can substitute the default WordPress logo with the following code inside the theme’s “functions.php” file.

Thanks to Smashing Magazine.

  1. //hook the administrative header output
  2. add_action('admin_head', 'my_custom_logo');
  3.  
  4. function my_custom_logo() {
  5. echo '
  6. <style type="text/css">
  7. #header-logo { background-image: url('.get_bloginfo('template_directory').'/images/custom-logo.gif) !important; }
  8. </style>
  9. ';
  10. }

Report this snippet  

You need to login to post a comment.