groups

name language licence
Alternate Post Styling On Your Home Page PHP Other
Customizing the Dashboard Widgets PHP Other
Fonts PHP Other
CSS Buttons CSS Other
Overwrite Post Titles Easily PHP Other
Add Multiple Sidebars PHP Other
Auto-Resize Images Using TimThumb And WordPress Shortcodes PHP Other
Dropping in Your Own Logo PHP Other

< 1 2 >



language: PHP
licence: Other

Dropping in Your Own Logo

options: view full snippetsend to code collector
Providing the client some administrative branding can be quick and easy. Here’s how to replace the default WordPress “W” logo in the administrative header with a custom alternative.

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.


//hook the administrative header output
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>
	
(Continues...)