Hi,
Thanks for contacting us about having a single page for logged out users, you can use the below snippet in your KLEO Child’s functions.php file to redirect all logged out users to a specific page.
COPY CODE
// Redirect to register if logged out and page is BuddyPress
function kleo_page_template_redirect()
{
//if not logged in and on a bp page except registration or activation
if( ! is_user_logged_in() &&
( ( ! bp_is_blog_page() && ! bp_is_activation_page() && ! bp_is_register_page() ) )
)
{
wp_redirect( home_url( '/register/' ) );
exit();
}
}
add_action( 'template_redirect', 'kleo_page_template_redirect' );
Change /register/ to your desired page, you should keep your home page set as it is in Settings > Reading
Thanks,
Kieran
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution