Gordonmac Dot Com

Mostly a web development blog

Customising the WordPress admin area

Posted: August 23rd, 2011 | Tags: | Posted in: PHP, Tutorials, Wordpress
Note: This tutorial was originally published in 2011. The tips and techniques explained may be outdated.

If you would like to customise your WordPress admin pages these functions are an excellent start. In this little tutorial we’ll look at customising the WordPress logo in the WordPress admin area, editing the WordPress admin footer to include your own company name and also customising the “Howdy” greeting in the top left of the WordPress admin area.

Edit the WordPress admin Logo

In your template folder open the functions.php file and simply add the following php code:

/**
  * my_custom_logo
  * Replace WordPress logo in Dashboard
*/
function my_custom_logo() {
  echo '
  <style type="text/css">
  #header-logo { background-image: url('.get_bloginfo('template_directory') . '/images/logo.jpg) !important; }
  </style>';
}
add_action('admin_head', 'my_custom_logo');

Now upload your own logo (must be 16px X 16px) to the images directory in your template folder.

Edit the WordPress admin footer text

In your template folder open the functions.php file and simply add the following php code:

/**
  * edit_admin_footer
  * Replace footer text in WordPress Dashboard
*/
function edit_admin_footer() {
  echo 'Content management system provided by <a href="http://www.yourcompany.com/">Your Company Ltd</a>.';
}
add_filter('admin_footer_text', 'edit_admin_footer');

Edit the text and link to suit your own needs

Edit the WordPress “Howdy” welcome message

In your template folder open the functions.php file and simply add the following php code:

/**
  *
  *
  * @param string  $translated
  * @param string  $text
  * @param string  $domain
  * @return Welcome to... instead of 'Howdy'
*/
function change_howdy($translated, $text, $domain) {
 if (!is_admin() || 'default' != $domain)
  return $translated;
 if (false !== strpos($translated, 'Howdy'))
  return str_replace('Howdy', 'Welcome to your website admin area', $translated);
 return $translated;
}
add_filter('gettext', 'change_howdy', 10, 3);

Edit the text to suit your own needs

Hope these help someone.