Skip to:
Content
Pages
Categories
Search
Top
Bottom

landing page after connexion


  • carosch
    Participant

    @carosch

    Hello,

    I need to landing on the “My groups” page just after connexion.
    How can I do that?

    Caroline

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

  • shanebp
    Moderator

    @shanebp

    If you mean after logging in, put this in your theme’s functions.php

    function carol_redirect_to_profile( $redirect_to_calculated, $redirect_url_specified, $user ) {
    
    	if ( ! $user || is_wp_error( $user ) ) {
    		return $redirect_to_calculated;
    	}
    
    	if ( empty( $redirect_to_calculated ) ) {
    		$redirect_to_calculated = site_url();
    	}
    
    	if ( function_exists( 'bp_core_get_user_domain' ) && ! is_super_admin( $user->ID ) ) {
    		$url = bp_core_get_user_domain( $user->ID );
    		return $url . 'groups/';
    	}
    
    	return $redirect_to_calculated;
    }
    
    add_filter( 'login_redirect', 'carol_redirect_to_profile', 100, 3 );

    carosch
    Participant

    @carosch

    Hello,

    thank you that works perfectly.

    I wonder to land on the group page, tab my groups
    but my profile/my group is ok too

    thank you
    Caroline


    carosch
    Participant

    @carosch

    And do you know how to apply this on the home link (website title)?

    Caroline


    carosch
    Participant

    @carosch

    Hello @shanebp,
    can you help me to apply the same link on the website title / logo?

    Caroline

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Skip to toolbar