Redirect to front page wordpress if not logged in
I'm looking to redirect a user to a specific page if they are not logged
in. So blog.com/welcome
So they can either be viewing this page or wordpress login pages. I was
trying to modify this plugin
http://wordpress.org/plugins/redirect-to-login-if-not-logged-in/
add_action( 'wp', 'dmk_not_loggedin_redirect' );
function dmk_not_loggedin_redirect() {
global $pagenow;
However I am ending up with redirect loops. And I could use some help to
stop this.
if ( ! is_user_logged_in() && $pagenow != 'wp-login.php' or
'http://www.blog.co.uk/front' )
wp_redirect( 'http://www.blog.co.uk/front' , 302 ); exit; }
No comments:
Post a Comment