Redirect from Events Calendar page not working
-
I’m trying to redirect logged out users from the Events calendar page to the home page, but it doesn’t work. This works for other pages including the single event posts. However on the Events calendar page the page is not redirected it just shows a blank white page.
function ghostpool_restrict_logged_out_user_access() { if ( is_user_logged_in() ) { return; } if ( is_post_type_archive( 'tribe_events' ) ) { wp_redirect( home_url( '/' ) ); } } add_action( 'template_redirect', 'ghostpool_restrict_logged_out_user_access' );
I’ve tested this with all other plugins disabled, using the default Twenty Twenty-One theme, with high and low priorities for the action, and the issue still occurs.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Redirect from Events Calendar page not working’ is closed to new replies.