In order to display all the used/non used categories in sidebar of a wordpress blog one need to modify below mentioned code:
1) First download category-template.php file at local system.
2) Open it to edit the file and chage the following code:
3) Save the file and upload it on the web server.
One can get this file from below mentioned path: