STEP 5:Navigate to Manage Communities from the setup menu, and click the 'Force.com' link as below

STEP 6:

Make the following changes as shown below.

STEP 7:

Modify the Apex Class 'CommunitiesLoginController' as belowSTEP 8:Modify the Visualforce page 'CommunitiesLogin' as belowSTEP 9:Make sure you publish the community. Navigate to the URL and you should see the custom login page as below.