Leave a comment

How to Make WordPress Easier for Clients, Part 1: Custom Branding

WordPress is one of the web’s most popular Content Management Systems. The appeal is obvious: it’s flexible, it’s easy to create custom templates, it offers a huge quantity of plugins, hundreds of themes are available, the application is open source and it’s free. It’s also relatively simple for clients to understand — that’s one of the main reasons I use it.I recently posted the article Do Your Clients Use Their CMS? I concluded that many CMSs can be daunting, appear technical, use jargon, or offer too many superfluous options. WordPress may be one of easier systems but it could be simplified further. Fortunately, we can address many issues with a little PHP magic.In this series of articles we’ll implement several options to make WordPress easier for your clients. You can probably find plugins to achieve the same thing, but this code is easy, flexible, and won’t need to be updated (unless you want to make updates yourself).

functions.php

The following WordPress modifications change your theme’s functions.php file. This file is optional and it’s automatically loaded when you view an administration page or the website itself. The file is normally used to define regularly-used template functions, but it can also implement plugin-like behavior.Since functions.php is activated with your theme, it’s easy to distribute between WordPress installations without having to download, enable or update plugins. If your current theme does not contain a functions.php file, simply create one and add PHP delimiters:

<?php// code will go here?>

tip: PHP delimiters

The closing “?>” isn’t strictly necessary and many PHP developers will tell you that it shouldn’t be used — but that’s a topic for another article!

Changing the WordPress login logo

There’s nothing wrong with the WordPress logo, but few clients will care what CMS they’re using. Why not use their logo or branding?The logo file is /wp-admin/images/logo-login.gif. Although you can remove or change that file, it will reappear whenever you update WordPress.

Here’s a better solution:

  1. Create/obtain your client’s logoIt’s best to resize the image so it’s no larger than 326 x 82 pixels. Copy the image file to your theme folder — in the following code, we’ll assume it’s named logo.png.
  2. Update your theme’s function.php filePlace the following code in function.php to change the default logo. Remember to modify thelogo.png file reference if you named it differently.

// login page logofunction custom_login_logo() {    echo ‘<style type=”text/css”>h1 a { background: url(‘.get_bloginfo(‘template_directory’).’/logo.png) 50% 50% no-repeat !important; }</style>’;}add_action(‘login_head’, ‘custom_login_logo’);

Removing WordPress update notifications

The WordPress administration panels inform you when a new version is available. Unfortunately, it tells everyone — including your clients. That could lead to unnecessary concern or persuade them contact you every half an hour until the update is applied.Add the following code to your theme’s functions.php file to disable the update notification for everyone except WordPress administrators:

// remove upgrade notificationfunction no_update_notification() {    remove_action(‘admin_notices’, ‘update_nag’, 3);}if (!current_user_can(‘edit_users’)) add_action(‘admin_notices’, ‘no_update_notification’, 1);

I hope you found those two examples useful. 

Tutorial provided by: sitepoint.com

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: