This topic has 4 replies, 3 voices, and was last updated 11 years by vault.

  • Author
  • #5228
     gideon1210
    Participant

    How do you redirext the homepage so if someone is already logged in instead of them seeing the homepage it will send the straight to the members page

    #5275
     SQadmin
    Keymaster

    Hi,
    That implies some php code added to your sweetdate-child/functions.php
    This time I will provide you the code:

    COPY CODE
    
    add_action( 'template_redirect', 'my_redirect_home' );
    
    function my_redirect_home() 
    {
        if( is_user_logged_in() && is_front_page() )
        {
            wp_redirect( site_url( 'members' ) );
            exit();
        }
    }
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #5325
     gideon1210
    Participant

    Thanks that works fine how do i redirect it to the users profile if i change

    wp_redirect( site_url( ‘members’ ) );

    to

    wp_redirect( site_url( ‘members/profile’ ) );

    it doesnt redirect

    #5326
     SQadmin
    Keymaster

    wp_redirect(bp_get_loggedin_user_link());

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #5525
     vault
    Participant

    This worked for me. Thanks

Viewing 5 posts - 1 through 5 (of 5 total)

The forum ‘Sweetdate – WordPress’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?