Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)

  • benofinil
    Participant

    @benofinil

    I really need someone’s help, I think the solution is quite easy, but I don’t know to code php…


    benofinil
    Participant

    @benofinil

    I found this code and it works perfectly !
    Hope it will help some of you…

    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( ‘/login/’ ) );
    exit();
    }
    }
    add_action( ‘template_redirect’, ‘kleo_page_template_redirect’ );

Viewing 2 replies - 1 through 2 (of 2 total)
Skip to toolbar