Customizing the WordPress Login Logo

For WordPress Login, the default login page will be look like this:

defaultlogin

When designing a Theme, sometime you may want to customize the logo on the login page instead of default WordPress Image.  There are several ways to do this, mostly involving plugins.  We can also add couple lines to our theme to achieve that.

First, add this code to your functions.php file:

This will trigger when action hook “login_head” starts, and will add a style sheet YOUR_THEME_DIRECTORY/css/login.css to the login page.

Next, create a stylesheet called login.css under your theme directory.  In this case, it should be created under the sub folder called css.

The stylesheet should attach your logo image.  I use a image that I upload as example.  (wp-content/uploads/2013/10/cropped-sunnycyk.png)

Now, just refresh your login page, you will see the logo changed!

Screen Shot 2013-10-25 at 11.15.59 pm

 

Read More

WordPress Trick for Local Configuration

When developing WordPress Site, sometime you may need to have more than one configuration such as different Database settings.  For example, I may have one database setting for my local machine and one for my webserver.  There are many ways to handle that, and my trick is this:

First create a file called local-config.php

Then in wp-config.php, modify little bit:

The magic here is you only keep local-config.php in your local machine.  When WordPress starts, it will try to locate local-config.php under the same directory of wp-config.php.  If it successfully located the file, it will use the configuration in local-config.php instead.  Otherwise, default config for your deployment server will be used if that file is not found.

You can apply the same logic for different environment settings.  :-)

Read More