This paper is devoted to path following control for port-Hamiltonian systems whose desired path is timevarying. Most of the existing results on path following can only take care of time invariant paths, hence they cannot be applied to control systems whose environments change, e.g., path following control with moving obstacle avoidance or with a path crossing itself. The proposed method solves this problem by employing decoupling control of three particular directions in the phase space which allows one to assign time-varying potential functions and vector fields.