This information provided by https://support.hp.com is for HP LaserJet Pro MFP M28a, M28w, M29a, M29w, M30a, M30w, and M31w printers on a computer with Windows.
To set up a HP LaserJet Pro M28 - M31 printer on a wireless (Wi-Fi) network, install the print driver and software from the HP website. When prompted during the installation, select Wireless as the connection type.