Logged In menu not showing after redirect
-
Hello!
I’m working on a website that changes it’s homepage depending on whether a user is logged in or not. If they log in and access the front page, they will be redirected with the following code:add_action('template_redirect', 'add_login_check'); function add_login_check() { if ( is_user_logged_in() && is_front_page() ) { wp_redirect('https://www.mysite.nl/subdomain'); exit; } }
Besides this, I use the plugin so members see different sub-items in their menus. However, if they are successfully redirected with the code displayed above, the menu will still be displayed as if they were not logged in. I’ve tried changing the hook in my code as well, but of no avail – either the problem continues or the redirection does not happen at all (but the menu does change).
Thanks in advance to anyone who can help out with this problem.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Logged In menu not showing after redirect’ is closed to new replies.