Sounds like you want a strictly private blog. Presumably, you don’t want to give access to the search engines and other crawlers either. If so, just protect your whole blog with htaccess/htpasswd.
Thanks pizdin_dim but this is not ideal for me as it will negatively affect the user’s experience.
Is there any other way?
i.e. if the user is not logged in, redirect them to the login/register page. I guess some kind of WordPress modRewrite rule equivalent would be ideal.
Maybe plug-in is the only way.
Thanks.
I’m not aware of any plugins for this but you could (in theory) do something like this:
<?php
if (!isset($user_level)):
header('Location: ' . get_settings('siteurl') . '/login.php?redirect_to=' . $_SERVER['REQUEST_URI']);
endif;
?>
Put it at the top of the “header.php” file in your active theme.