Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 1 replies (of 1 total)

  • ahmedmusawir
    Participant

    @ahmedmusawir

    Brajesh from BuddyDev.com was gracious enough help me with the following solutions verbatim:

    Hi Moose
    Thank you for the question.

    To answer your question.

    1. The front template for member type works, but it is not what you are expecting. The front template is used to show the contents inside the content area(below the member header where you see activity etc)

    2. If your goal is to completely control the profile page layout by member type, we can easily do it by forcing bp to load our own template if exists.

    add_filter( 'bp_template_hierarchy_members_single_item', function ( $templates ) {
    
    	$member_types = bp_get_member_type( bp_displayed_user_id(), false );
    	foreach ( $member_types as $member_type ) {
    		array_unshift( $templates, "members/single/index-type-{$member_type}.php" );
    	}
    
    	return $templates;
    } );

    Now, you can create buddypress/members/single/index-type-somemembertype.php and that will be the one used for whole page(You will need to include headers/footers etc manually here).

    Regards
    Brajesh

Viewing 1 replies (of 1 total)
Skip to toolbar