Skip to:
Content
Pages
Categories
Search
Top
Bottom

setting the profile page as main page

  • Avatar of programer2013
    programer2013
    Participant

    @programer2013

    hi all.i want the profile page of user to be served as main page of my buddypress ..i have used static page option..as by default ..buddyrpess create three pages..activity.groups etc.
    so i can make them as main static page..my requironments is..i want the user profile page to be serve as main page..thanks for ur reply in advance

Viewing 2 replies - 1 through 2 (of 2 total)
  • Avatar of Henry
    Henry
    Participant

    @henrywright-1

    add this line to your bp-custom.php file

    define( 'BP_DEFAULT_COMPONENT', 'profile' );

    Avatar of bp-help
    bp-help
    Participant

    @bphelp

    @programer2013
    Expanding on @henrywright-1 suggestion you can add the below code to bp-custom.php
    It will prohibit logged out visitors from viewing BP Pages and redirect to registration. Upon login it will direct them to their public profile.

    
    define( 'BP_DEFAULT_COMPONENT', 'profile' );
    function bp_help_restrict_login_and_redirect_to_profile() {
    global $bp;
    $bphelp_change_slug = 'register'; //* if you changed 'register' to 'sign-up' then change 'register' in this variable accordingly EXAMPLE: change 'register' to 'sign-up' *//
    
    if ( !is_user_logged_in() && !bp_is_register_page() && !bp_is_activation_page() )
      bp_core_redirect( get_option('home') . '/' . $bphelp_change_slug );
    
    elseif( is_user_logged_in() && bp_is_register_page() )
      bp_core_redirect( get_option('home') . '/members/' . bp_core_get_username( bp_loggedin_user_id() ) . '/profile' );
    
    }
    	
    add_action( 'wp', 'bp_help_restrict_login_and_redirect_to_profile', 3 );
    
Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.