Skip to content

Instantly share code, notes, and snippets.

@aobasar
Last active August 29, 2015 14:25
Show Gist options
  • Save aobasar/c4789320bd335041102e to your computer and use it in GitHub Desktop.
Save aobasar/c4789320bd335041102e to your computer and use it in GitHub Desktop.
wordpress back-end branding functions
// these changing in themes_folder/function.php
// 1. Change the login logo
// Important: logo should be at least 323px by 67px.
// Here’s the code you’ll need:
function login_logo() { ?>
<style type="text/css">
body.login div#login h1 a {
background-image: url(<?php echo get_bloginfo( 'template_directory' ) ?>/images/logo_login.png);
}
</style>
<?php }
// Now that we have the function, we just need to hook it into WordPress using the login enqueue scripts hook:
add_action( 'login_enqueue_scripts', 'login_logo' );
// 2. Change the dashboard logo
// Important: make your image 20px by 20px.
function dashboard_logo() {?>
<style type="text/css">
#wp-admin-bar-wp-logo > .ab-item .ab-icon {
background-image: url(<?php echo get_bloginfo( 'template_directory' ) ?>/images/logo_admin.png) !important;
background-position: 0 0;
}
</style>
<?php }
//Hook this into WordPress using the admin head hook:
add_action('admin_head', 'dashboard_logo');
//3. Change the footer text
function admin_footer () {
echo '© Copyright '.date(Y).' Awesome Company';
// echo '<br/>';
// echo 'Page load time: '. timer_stop() . ' and ' . get_num_queries().' queries.';
}
//Now to hook it into WordPress you just need the admin footer text hook:
add_filter('admin_footer_text', 'admin_footer');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment