Connecting the printer to your wireless connection and the router is one and the same. It is the same wireless network.
On the printer screen, go to Setup > Network > Restore network settings
Go back to Network > Wireless > Wireless setup wizard and select your wireless network.
Make sure the printer and the PC are connected to the same wireless network.
This printer supports only 2.4GHz network. So, the PC should be on the 2.4GHz network.
If you have a Dual-band router and both 2.4GHz and 5GHz networks share the same name/SSID, the printer will not be able to connect to the network. In this case, contact your Internet service provider to assign different names to both the networks.
Hope this helps! Keep me posted.
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!
Have a great day!
KUMAR0307 I am an HP Employee
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".