We numerically study the behavior of two-dimensional skyrmions in the presence of a quasi-onedimensional sinusoidal substrate under the influence of externally applied dc and ac drives. In the overdamped limit, when both dc and ac drives are aligned in the longitudinal direction parallel to the direction of the substrate modulation, the velocity-force curves exhibit classic Shapiro step features when the frequency of the ac drive matches the washboard frequency that is dynamically generated by the motion of the skyrmions over the substrate, similar to previous observations in superconducting vortex systems. In the case of skyrmions, the additional contribution to the skyrmion motion from a non-dissipative Magnus force shifts the location of the locking steps to higher dc drives, and we find that the skyrmions move at an angle with respect to the direction of the dc drive. For a longitudinal dc drive and a perpendicular or transverse ac drive, the overdamped system exhibits no Shapiro steps; however, when a finite Magnus force is present we find pronounced transverse Shapiro steps along with complex two-dimensional periodic orbits of the skyrmions in the phaselocked regimes. Both the longitudinal and transverse ac drives produce locking steps whose widths oscillate with increasing ac drive amplitude. We examine the role of collective skyrmion interactions and find that additional fractional locking steps occur for both longitudinal and transverse ac drives. At higher skyrmion densities, the system undergoes a series of dynamical order-disorder transitions, with the skyrmions forming a moving solid on the phase locking steps and a fluctuating dynamical liquid in regimes between the steps.