WordPress quick tip #8 – Three quick and easy WordPress admin customisations
- Date:
- 17 Aug 2010
- Category:
Having put time and effort providing a custom theme for a client, with a few extra minutes of coding it’s possible to add a degree of personalisation to the admin pages too with these three functions.
Replace WordPress logo with client logo
The following function will allow you to replace the WordPress logo at the top of the admin pages with that of your client. via this article on Smashing Magazine
function custom_admin_logo() {
echo '
<!--
#header-logo { background-image: url('.get_bloginfo('template_directory').'/images/custom-logo.gif) !important; }
-->
';
}
add_action('admin_head', 'custom_admin_logo');
Customise the admin footer
Replace the standard footer with code of your choosing. I regret that I can’t credit the original source of this code.
function Custom_admin_footer() {
echo 'Powered by <a href="http://www.wordpress.org" target="_blank">WordPress</a> | Designed by <a href="http://www.creativeglo.co.uk" target="_blank">Creative Glo</a>
';
}
add_filter('admin_footer_text', 'Custom_admin_footer');
Provide a custom dashboard panel
On client sites I use this to provide my contact information, theme version and a link to the theme changelog. On my own site I place links to my accounts on linked in, behance, twitter and so on. Regret that I can’t credit the original source of this code either.
add_action('wp_dashboard_setup', 'theme_dashboard_panel');
function theme_dashboard_panel() {
global $wp_meta_boxes;
wp_add_dashboard_widget('custom_help_widget', 'Theme information', 'custom_dashboard_help');
}
function custom_dashboard_help() {
$template_directory = get_bloginfo('template_directory');
$style_Path = get_theme_data($template_directory . '/style.css');
$site_version = $style_Path['Version'];
$description = $style_Path['Description'];
echo '
<ul>
<li>Version ' . $site_version . '</li>
<li> ' . $description . '</li>
<li><a href="' . $template_directory . 'path-to-file.txt" target="_blank">View Changelog</a></li>
</ul>
';
}
for more on get_theme_data() See here.
Customise the sign in page
It’s also pretty easy to customise the login page, wp-login.php. There’s a tutorial covering how to do this using a plugin here, and how to do this with functions here.