A four degrees of freedom (DoF) waist and trunk mechanism, as well as human-like foot, enable the humanoid robot WABIAN-2R to perform human-like walk with stretched knees, and heel-contact and toe-off gait phases. The inverse kinematics (IK) method, used in the present system, requires specification of not only task space reference trajectories, but also reference trajectories for all redundant DoFs. In this paper, we propose a novel, unified inverse kinematics method significantly simplifying the pattern generation. The method enables generation of the above described gait by specifying only the task space trajectories. We divide the forward locomotion task into subtasks with different priorities and combine them in the single IK equation. We also perform experiments in simulation environment as well as on WABIAN-2R, which prove that the method can be used to calculate IK for human-like gait. The equation evaluated in this paper is applied to the forward locomotion task, however it can be easily modified to perform other tasks on humanoid robots with different kinematic structures.