Need help asap

I will get right to the point. My temp. gauage does not work it does not turn only once in a great while,and my fans only turn on after I turn off the car. I have tried replacing the Engine cooling temp sensor and nothing changed. If I dont fix this soon I will be forced to put a gay aftermarket temp gauge and have to run a switch to the fans. any help would be great.