Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to redirect user to their Buddypress profile


  • slimdevil
    Participant

    @slimdevil

    How can I make this possible?

    1. Add a wordpress page. Probably, blank.
    2. Everytime a user lands on that page, it will redirect to their Buddypress profile page.

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

  • Prashant Singh
    Participant

    @prashantvatsh

    Hi,

    Please paste the following code snippet in child theme’s functions.php or bp-custom.php

    function ps_redirect_profile() {
        if(is_user_logged_in()){
           if(is_page('your_page_slug'))
           {
              wp_redirect( bp_core_get_user_domain( get_current_user_id() ));
              exit;
           }
       }
    }
    add_action( 'wp', 'ps_redirect_profile' );

    Thanks


    slimdevil
    Participant

    @slimdevil

    It worked perfectly!

    Thank you very much Sir Prashant Singh. You save the day.

    Let’s mark this as SOLVED.


    Prashant Singh
    Participant

    @prashantvatsh

    That’s great 🙂

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