保护所有文件夹和文件内容,但可以访问网站wordpress

Googled shows password protect via .htaccess file wp-admin, wp-includes,wp-config folders n file resp. or use host server option of protecting directories.This locks webpages asking password. to a visitor. I Need to lock on server side and displaying web pages. So on Cpanel wp-admin folder to be locked on server side and www.example.com/wp-admin.php through link but website www.example.com & pages www.example.com/watches www.example.com/walls...etc should be displayed .htaccess file and uploading it in /wp-admin/ directory locks website pages too following codes in there:

AuthName "Admins Only"
AuthUserFile /home/yourdirectory/.htpasswds/public_html/wp-admin/passwd
AuthGroupFile /dev/null
AuthType basic
require user putyourusernamehere