I think I may have found the navigation bar that has to do with users profiles location. Called home.php
, in it I see some lines like :
<?php do_action( 'bp_before_member_body' );
elseif ( bp_is_user_friends() ) :
locate_template( array( 'members/single/friends.php' ), true )
elseif ( bp_is_user_forums() ) :
locate_template( array( 'members/single/forums.php' ), true );
So I see the tags “friends” and “forums”. I assume I have to make an If/else statement.
1.) I guess an example code of what I need help with would be
if ( is_user_logged_in() ) {
// SHOW FRIENDS TAB AND FOURMS TAB
<?php } else { ?>
// SHOW NO FRIENDS TAB, SHOW NO FOURMS TAB
<?php } ?>
2.) And Would I place the If/Else statement you help me with in the home.php file or my child theme functions file?
You’re looking at the templates that render the content for tabs.
But you want to remove tabs.
Because ‘groups’ may be the only tab available, you need to make ‘groups’ the default component.
You may need to add or remove one or more add_filter
calls depending on your installation.
Try this in your bp-custom.php file:
define( 'BP_DEFAULT_COMPONENT', 'groups' );
function izzy_adjust_profile_nav() {
if ( ! is_user_logged_in() ) {
add_filter('bp_get_displayed_user_nav_activity', 'izzy_profile_nav_remove', 10, 1 );
add_filter('bp_get_displayed_user_nav_friends', 'izzy_profile_nav_remove', 10, 1 );
add_filter('bp_get_displayed_user_nav_forums', 'izzy_profile_nav_remove', 10, 1 );
add_filter('bp_get_displayed_user_nav_xprofile', 'izzy_profile_nav_remove', 10, 1 );
}
}
add_action( 'bp_init', 'izzy_adjust_profile_nav' );
function izzy_profile_nav_remove($nav_array) {
$nav_array = '';
return $nav_array;
}
Wow that worked thank you so much for your great help !