Please try the steps below to connect your printer to the network.
-->On the printer control panel, press and hold the Wireless button and the Resume button together for three seconds. (When Wi-Fi Direct is turned on, the Wi-Fi Direct icon on the display stays on)
--->On your computer or phone go to wifi and connect it to your printer
--->Select your printer with DIRECT in the name from the list of available networks (example: DIRECT-74-HP Deskjet2700).
--->Select the Wi-Fi Direct printer signal in Wi-Fi settings
--->If prompted for a password, type 12345678. This is the default password to log in.
--->Now open a browser and type 192.168.223.1
--->you will be able to access the printer's EWS page
--->on the page, you will find network - click on it
--->go to wireless and select wireless setup wizard
--->now select the network that you want your printer to connect to and type in the password
--->the printer will have solid blue light if it's connected
--->then connect your phone back to your network
Hope this helps! Keep me posted.
And, Welcome to the HP Support Community.
Please click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution.
Click the “Kudos, Thumbs Up" on the bottom right to say “Thanks” for helping
Be alert for scammers posting fake support phone numbers and/or email addresses on the community. If you think you have received a fake HP Support message, please report it to us by clicking on "Flag Post".