Require login to view a WordPress site

On a WordPress site I have setup, I needed the ability to require user authentication before allowing anyone to view the website. To do this, just add the following snippet to the theme files:

global $user_ID;
if ($user_ID == '')
        header('Location: wp-login.php');

Now you will be greeted with the WordPress login page when entering the site without being authenticated! Note that if you want to be completely sure that no one can retrieve any information without authenticating, you need to either modify the WordPress core files, or use some other type of authentication outside of the WordPress code, such as a basic auth in the webserver.

Edit: I created a WordPress plugin which does this in a much better way – WP Require Auth plugin.

Who turned off the light?

So I have once again changed the theme for this site, because I just don’t have enough things to do already. I started out with the Hemingway theme and changed the color scheme, fonts, layout and some other things.

As a result, some things will definitely be broken for a while until I fix everything up. Oh, and please don’t use Internet Explorer. 😉

Good morning — brighting it up

I have received some complaints for my website being white-on-dark, which supposedly makes it harder to read. So I will of course abide and change it, but now I will not just change the colors, but the entire theme has been upgraded. Sure, there are some kinks and other mind numbing problems, but they will disappear in time.

There seems for instance that there is a problem with the Article plugin, which means that finding interesting posts is probably somewhat harder. I really need a “top posts” widget too I guess.

[poll id=”2″]