I've done this town a lot for business and pleasure for the past 40 years...with and without small kids. Taking a two year old is going to dictate a bit of what you do. Personally, when I took the kids anywhere, I paid a bit more for the convenience, and it paid off everytime (like staying at THE Disneyland Hotel so you could go back to it several times a day from the park). Personally, I'd stay somewhere near Union Square as the kid's gonna get tired quick (and so will you) walking around downtown. Also, you'll have direct access to the cable cars to get to 90% of where you want to go.
I'd also go full service...you're not going to want to go out for a meal every time. To me, the St. Francis is worth the price of admission all things considered. Stay in the modern tower to save a few bucks. Rental car agencies in the lobby. To me, the grand old hotels are what Frisco is all about. Take a lightweight stroller that's easy to carry when the kid gets tired of it.
Make sure you make time for Golden Gate Park...let the kid have some runaround time. Always stuff going on...kites, model yachts, the aquarium is great. The Exploratorium down near the Marina is perfect for kids...but check times, etc. and see if large groups (schools) are coming through.
Watch out staying off Union Square too far...Theater District is a mixture of coolness and scum, and the China Town side ain't much better. Hyatt at the Embarcadero Center is a good area...local shopping and the bay is right there for evening strolls.
As someone else said...it gets cold in the summer. Mark Twain said it best..."the coldest winter I ever saw was the summer I spent in San Francisco."
[EDIT...just saw Imagine quoted him first, so there shouldn't be any question about it.
]The wind comes off the cold waters of the bay and whips around the glass and steel canyons of downtown. Be ready to layer.
North Beach...go during the day.
Union Street...good shopping for the wifey.
Screw the buses...take taxis. Quick and it'll give you a taste of Bullitt if you have them take you up California from the Financial District to Nob Hill.
Get a car for a day and head over the Golden Gate to Sausilito and further on to Muir Woods in Marin County. Wine Country? Bypass the town of Napa and hit Yountville, Rutherford and St. Helena. Sonoma in Sonoma Valley is even closer and a nice walk around town center.
If you head east to Yosemite through the East Bay...try to hit the Blackhawk Museum off 680...one of the great car collections on this or any other planet.
Now Yosemite...my backyard. Try to find time to go out on Glacier Point...overlooks Yosemite Valley and the spot from which the Half Dome views you see in magazines are taken from. Enjoy the Valley, but unless you score a room at the Awanhee (try...cancellations do happen), get out of there after a day...way too crowded. Worth every cent for the views and service. Sit in the meadow below El Capitan and watch the rock climbers. Wawona is away from the Valley on the southern edge of the park, has a great historical hotel, and neat stuff for the kid (wagon rides, etc.)...easy walking to a some damn big Sequoias.
You wanna see the REAL Yosemite, go up on 120 (Tioga Pass) to Tuolumne Meadows around 8500 feet and hopefully stay in the cabins or the resort up there. That's where I grew up backpacking and it is the most sublime place on earth.
Are you flying back out of San Francisco? Might be easier to see if you can fly back out of Fresno...Delta and American fly east out of here.
Heading from San Franciso to Yosemite, do NOT go in on 140...lots of road construction going on with the road falling into the river. Take 120 out of Manteca (straight shot from Frisco), the old route, but an easier drive. Also...check out Gold Rush towns en route...Angels Camp, Sonora, etc.