BuddyDev

Search

Buddypress Default Landing Page Based on Member Type

  • Participant
    Level: Enlightened
    Posts: 90
    Sujee Kulendran on #15125

    Hi Brajesh,

    You had kindly provided me with the code to redirect members based on member type to their profile pages using this code:

    function buddydev_set_member_type_based_default_component() {
    if ( bp_is_user() && bp_has_member_type( bp_displayed_user_id(), ‘admissions-counselor’ ) ) {
    define( ‘BP_DEFAULT_COMPONENT’, ‘home’ ); //change groups with the slug of the tab you want to be default.
    }else {
    if ( bp_is_user() && bp_has_member_type( bp_displayed_user_id(), ‘guidancecounselors’ ) ) {
    define( ‘BP_DEFAULT_COMPONENT’, ‘profile’ ); //change groups with the slug of the tab you want to be default.
    }
    }
    }

    Is there a way to add more than 2 situations here? I have other member types as well but I get a 404 issue since it is not indicated in the above code. Do I just add another ‘else if’ statement? If so, could you provide me a quick example with the ‘student’ member type and slug ‘profile’.

    Thank you,

    Sujee

  • Keymaster
    (BuddyDev Team)
    Posts: 24190
    Brajesh Singh on #15154

    Hi Sujee,
    It can be easily added but I will suggest to wait for next 2-3 days. I am adding the dynamic redirection (also custom landing tabs) to our member types plugin.

    That will make it way better for you.

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 90
    Sujee Kulendran on #15156

    Awesome- thank you!!

You must be logged in to reply to this topic.

This topic is: not resolved