Web developer - Web analytics specialist

Disable WordPress theme changing

You’ve probably spent a lot of hours customizing the site’s theme, maybe even built it from the ground up to meet your client’s very specific needs. Either way, if you client swapped the theme it could spell disaster. Luckily, there’s another handy code snippet you can use to remove the “Themes” menu item under “Appearances” in the admin sidebar. Just add this code to your functions.php file: This code will hide the Themes sub-menu from all users other than user ID 1, who is usually the person who setup the site. This allows only the site’s creator to edit the site without...

password

Protect website with password

You may want to restrict the development site from search engine or from direct access. One of the popular way of doing so is to use Apache2 Basic Authentication. Here we will be discussing on how to password protect your development site using Apache2 Basic Authentication which makes a use of .htaccess & .htpasswd files. Steps: 1. Create & upload .htaccess file to the root of your dev site with the following content: AuthName "Authorisation Required" AuthUserFile "/path/to/.htpasswd" AuthType Basic require valid-user ErrorDocument 401 "Authorisation Required" Notes: If .htaccess file already exists then you can add the above code on the...