Forum Replies Created
Viewing 4 posts - 1 through 4 (of 4 total)
-
AuthorPosts
-
hrc
ParticipantSo what should I do?
hrc
ParticipantYou mean like this?
add_filter( 'pre_get_posts', 'swpm_auto_redirect_non_members' ); function swpm_auto_redirect_non_members() { if( !is_admin() && !SwpmMemberUtils::is_member_logged_in() && !is_page( array( 'membership-login', 'membership-join' )) ) { wp_redirect( 'http://lifestyle-supportguide.com/membership-login/' ); exit; } }Actually, I did.
But in my administration tool(under /wp-admin), it created infinity loop with “too many redirect”.hrc
ParticipantAh, you’re correct. Actual url is here.
http://lifestyle-supportguide.com/I think it’s plain wprdpress page.
hrc
Participantmbrsolution, Thanks. Here’s my code.
add_filter( 'pre_get_posts', 'swpm_auto_redirect_non_members' ); function swpm_auto_redirect_non_members() { if( !is_admin() && !SwpmMemberUtils::is_member_logged_in() && !is_page( array( 'membership-login', 'membership-join' )) ) { wp_redirect( 'http://example.com/membership-login/' ); exit; } }If you are under published page, it’s OK. But if you are in admin page, it doesn’t work correctly.
-
AuthorPosts
Viewing 4 posts - 1 through 4 (of 4 total)