[Resolved] Redirect from members page to profile page
-
I don’t want users to be able to see the members page, but rather redirect to their own profile page if they try to reach it (there is no accessible way through the menu, but just in case a savvy user types it into their URL).
I have :
add_action( 'template_redirect', 'redirect_members_page' ); function redirect_members_page() { global $current_user; get_currentuserinfo(); if ($is_page('members')) { wp_redirect(home_url() . '/members/' . $current_user->user_login . '/profile/' ); exit; } }
Which obviously creates a redirect loop.
How can I specify the members/ component but not the profile page?
Bridie
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘[Resolved] Redirect from members page to profile page’ is closed to new replies.