The Interconnection and Damping Assignment Passivity-Based Control (IDA-PBC) problem for port-controlled Hamiltonian systems is revisited. We propose a methodology that exploits the novel notion of algebraic solution of the so-called matching equation. This notion is instrumental for the construction of an energy function, defined on an extended state-space, which does not rely upon the solution of any partial differential equation. This yields, differently from the classical solution, a dynamic state feedback that stabilizes a desired equilibrium point. In addition, conditions that allow to preserve the port-controlled Hamiltonian structure in the extended closed-loop system are provided. The theory is validated on two physical systems: th...