WordPress Membership Plugin
I am looking to auto redirect non logged in users on a specific page, not the whole site and bypass the default prompt “You need to login to view this content. Please Login. Not a Member? Join Us” and go straight to the login area.
Make sense??
I think so. I tweaked the code like so:
/*** Auto redirect a user who isn’t logged into the site ***/
add_filter( ‘pre_get_posts’, ‘swpm_auto_redirect_non_members’ );
function swpm_auto_redirect_non_members() {
if( !SwpmMemberUtils::is_member_logged_in() && !is_page( array( ‘membership-login’, ‘membership-join’ )) ) {
wp_redirect( ‘http://test.trustvesta.com/investor-login’ );
exit;
}
}
BUT the results are that my WordPress login gets broken.
Do I need to tweak the arry on line 3??
thank you in advance