Somnathpur is 8km south of Bannur on the Kanakapura Mysore route.
Head to Bannur and take the left diversion just ahead of Bannur. The Chennakesava Temple of Somnathpur is just off the main road.
Bangalore to Somnathpur via Kanakpura (distance 130km): Bangalore –- 50km -–>Kanakapura -– 50km –> Malavalli -–> 22km –-> Bannur --8km--> Somnathpur
Alternatively, you can drive to Mysore and head for Somnathpur. Select this route only if Mysore of part of your itinerary.
Two Routes from Mysore to Somnathpur:
Route 1: Mysore –>25km–>Bannur–>8km–>Somnathpur
Raoute 2: Mysore –>35km–>T.Narsipur–> 8km –>Somnathpur
Also checkout Bangalore to Talakadu route. You may even like the other attractions near to Somnathpur (the Cauvery Trail)
Bangalore to Somnatpur by Bus or Train:
Bus connections connections to Somnathpur is a bit sketchy, esp. the last 8km from Bannur.
Your best bet is to head for Mandya from Bangalore . There are good number of buses and trains to Manndya (all going from Bangalore to Mysore) . From Mandya bus station (located next to Mandya railway station) look for a bus to Bannur.
From Bannur to Somnathpur (about 8km) bus frequency is limited. There are some private and KSRTC buses operated on this route. You make even explore some shared vans or auto rickshaws.
Another alternative is to book in one of those KSTDC tour packages. Their itinerary includes Somnatpur along with other attractions.