Effective may 20th through Sept 30th, gate passes for private vehicles will again be required this year, ostensibly because of all the construction going on in the park. They are only $2 per vehicle but they disappear fast and are already on sale at recreation.gov – search on Yosemite Gate Passes.
Alternatives are to enter the park very early since passes are only required after 6am, or enter late, after 4pm. In summer this will still give you 4 hours of sunshine – enough to explore one trail say and stay for dinner. Otherwise, if you ride Yarts bus from nearby Mariposa or MidPines your bus ticket includes a gate pass.
Normal vehicle entrance fees still apply: $35 per vehicle unless you have some National Park pass. Liek the gate pass entrance is always good for 3 days.