How do I password protect a page of posts on WordPress?

When you create a page and assign it to “Page for post” in Settings->Reading, it is not considered a page anymore but an archive. Taht is why standard password protection doesn’t work. You will need to build the latest posts page at your own, for example using a page template and/or pre_get_posts action.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)