If you’re trying to use the Tumblr API, develop the website and also hide it from the general public… you will probably be having a few problems… just like we were!
If you are having issues, below are a few handy steps to help solve the problem:
First, create a div that will block any user from seeing the content on your site. I’ve added the script in-line to make sure there are no issues with loading external stylesheets – remember to change the background image!
<div style="background: url(image) no-repeat center center white; position: fixed; z-index: 1000; top: 0; left: 0; right: 0; bottom: 0;"></div>
Next you’ll need a little script to remove the div if it’s a correct password. If they enter a wrong password, we’ve got it set up to empty all of the contents of the site and redirect them – this makes sure they wouldn’t be able to see anything on your site!
var msg = window.prompt("Enter Your Password", "Password"); jQuery( document ).ready(function() { if(msg != "password"){ jQuery("body").remove(); window.location.replace("https://www.bigeyedeers.co.uk/"); }else{ jQuery(".pswdtest").remove(); } });
Change “password” to whatever you would like the password to be and also replace the website to whatever you’d like!
Finally, upload this script to Tumblr and hook it up to your theme. You’ll now be able to use your website to generate an API key to use more features of Tumblr whilst still having a locked website!
If you do have any questions for us about your current site or an upcoming project, feel free to get in touch and we would be more than happy to help out! Head to our contact page for the details to get in touch with the team in either our Cardiff or Cornwall offices!
Magento is the leading solution for eCommerce, and we’re specialists. Magento is easy-to-use, completely customisable and endlessly scalable.
We offer custom web development services for any requirement. Manufacturing from scratch, we deliver a project entirely tailored to your needs.
Working with brands nationally from our offices in Cardiff and Exeter, our tenacious team of designers and developers deliver sophisticated results every time.