This topic has 38 replies, 9 voices, and was last updated 10 years by willianlima83.

  • Author
  • #4908
     agentsrr
    Participant

    Hi, I am re-opening this topic because response was turned off in original topic. I placed the code below in functions.php and it gives me a 404 page not found error. What am I doing wrong?

    How do I hide the base profile that’s under the main profile, for users only? It’s just being repeated.

    Thanks,

    Duplicate topic: https://archived.seventhqueen.com/forums/topic/disable-profile-tab-below-profile-image

    #4935
     SQadmin
    Keymaster

    So instead of opening a new one again you could have added your response in the provided topic …

    So if you remove the tab you won’t be able to go to it.. that is why the 404 probably.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #4947
     adam
    Participant

    Hi Sqadmin – I am trying to remove all tabs from member’s profiles. The only one I have not been able to remove is Album from BP-Album. My code looks like this:

    function my_remove_profile_nav() {
    global $bp;
    if (!bp_is_my_profile()) {
    bp_core_remove_nav_item( ‘album’ );
    }

    }
    add_action( ‘bp_setup_nav’, ‘my_remove_profile_nav’ );

    But, I don’t think ‘album’ is correct. I tried search through the BP-Admin files and I see ‘Album’, ‘bp-album’ but that doesn’t seem to work together or individually. What should the name be?

    Thanks!

    #5000
     SQadmin
    Keymaster

    Hi, This way it works:

    COPY CODE
    
    function my_remove_profile_nav() {
    	if (!bp_is_my_profile()) {
    		remove_action( 'bp_setup_nav', 'bp_album_setup_nav' );
    	}
    
    }
    add_action( 'bp_setup_nav', 'my_remove_profile_nav', 9 );
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #5002
     agentsrr
    Participant

    Well I would have added my response if I was able to, but you closed further reply’s on those posts.

    Anyway’s I still don’t get it, I thought the code was to remove the bottom profile only? All it gives me is 404 error. I’m waiting to keep the main profile and tab that is beside the main profile picture, and delete the bottom profile only… What is the code to remove only the bottom profile so users can’t see it??

    #5003
     adam
    Participant

    Thanks!

    #5050
     SQadmin
    Keymaster

    You are getting an 404 error on all site? I don’t understand. This code will remove the “Profile” tab from the navigation menu in a member profile(not your own so you can still edit it):

    This snippet added to sweetdate-child/functions.php

    COPY CODE
    
    function my_remove_profile_nav() {
    	global $bp;
        if (!bp_is_my_profile()) {
            bp_core_remove_nav_item( 'profile' );
        }
    
    }
    add_action( 'bp_setup_nav', 'my_remove_profile_nav' );
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #5059
     sieglufer
    Participant

    Following this topic what will be the correct code to for functions.php to remove the Forums tab from Profile pages?

    I tried it myself but it gave me Fatal Error.

    #5061
     adam
    Participant

    Hi @seiglufer – This is how I removed the entire bottom navigation in functions.php:

    COPY CODE
    
    function my_remove_profile_nav() {
        global $bp;
        if (!bp_is_my_profile()) {
            bp_core_remove_nav_item( 'profile' );
            bp_core_remove_nav_item( 'groups' );
            bp_core_remove_nav_item( 'friends' );
            bp_core_remove_nav_item( 'forums' );
            bp_core_remove_nav_item( 'events' );
            bp_core_remove_nav_item( 'location' );
            bp_core_remove_nav_item( 'settings' );
        }
    
    }
    add_action( 'bp_setup_nav', 'my_remove_profile_nav' );
    
    function my_setup_nav() {
          global $bp;
    
          $bp->bp_nav['activity'] = false;    
    }
    
    add_action( 'bp_setup_nav', 'my_setup_nav' );
    
    function my_remove_album_nav() {
        if (!bp_is_my_profile()) {
            remove_action( 'bp_setup_nav', 'bp_album_setup_nav' );
        }
     
    }
    add_action( 'bp_setup_nav', 'my_remove_album_nav', 9 );
    

    Just remove ‘forum’ using the function above and erase everything else if that’s the only one you want removed.

    #5074
     agentsrr
    Participant

    I want to keep the Profile tab, but hide all of the “bottom navigation” to members only. Only when you are logged in to your profile you will still see everything and be able to edit your profile etc…

    The profile in the bottom navigation is just repeating what is in the top profile, it does not make any sense to show visitors the profile twice.

    FYI: I tried Adam’s code below but it gave me errors.

    #5078
     adam
    Participant

    @agentsrr – this is just a shot in the dark, but make sure the issue is that you’re not using the same function name twice in functions.php. it doesn’t allow for that.

    #5079
     agentsrr
    Participant

    Hi Adam,

    Yeah I’m not sure.. I was able to hide all the bottom navigation tabs except “profile” can you please send over the code to just remove profile?

    Thank you

    #5081
     adam
    Participant

    function my_remove_profile_nav() {
    global $bp;
    if (!bp_is_my_profile()) {
    bp_core_remove_nav_item( ‘profile’ );
    }

    }
    add_action( ‘bp_setup_nav’, ‘my_remove_profile_nav’ );

    #5096
     agentsrr
    Participant

    I’m getting this error: Fatal error: Cannot redeclare my_remove_profile_nav() (previously declared in… on line 62 which seems to be the “}” before, add_action( ‘bp_setup_nav’, ‘my_remove_profile_nav’ );

    Then if I delete line 62 it says there is a syntax error. Any suggestions?

    #5151
     SQadmin
    Keymaster

    You have another function named like that. Change the above name function:
    function my_remove_profile_nav2() {
    global $bp;
    if (!bp_is_my_profile()) {
    bp_core_remove_nav_item( ‘profile’ );
    }

    }
    add_action( ‘bp_setup_nav’, ‘my_remove_profile_nav2’ );

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #5246
     sieglufer
    Participant

    I added the following code to Sweetdate Child functions.php:
    <?php
    function my_remove_profile_nav() {
    global $bp;
    if (!bp_is_my_profile()) {
    bp_core_remove_nav_item( ‘forums’ );
    }

    }
    add_action( ‘bp_setup_nav’, ‘my_remove_profile_nav’ );
    ?>

    But the Forums tab is still there, is this the correct process?

    #5281
     SQadmin
    Keymaster

    See this topic: https://archived.seventhqueen.com/forums/topic/how-do-i-remove-the-forums-tab

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #5362
     sieglufer
    Participant

    Thanks, it worked!

    #5375
     agentsrr
    Participant
    This reply has been set as private.
    #6053
     agentsrr
    Participant

    I’ve tried all the code for the profile and nothing is working, It just keeps showing. I was able to remove everything else forums, album, etc.. with the code you posted, but not the profile tab. Again this is the tab that is located next to album etc that says “base” Is there something else that will work?

    Thanks!

    #6099
     SQadmin
    Keymaster

    See this topic: https://archived.seventhqueen.com/forums/topic/how-do-i-remove-the-forums-tab

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #6192
     hughm
    Participant

    I am able to hide the profile tab but cannot get the Album tab to go away with the above code. Here is what I am using per above recommendations:

    /**
    * Hides the Profile tab in member profile pages
    */
    function my_remove_profile_nav() {
    global $bp;
    if (!bp_is_my_profile()) {
    bp_core_remove_nav_item( ‘profile’ );
    }

    }
    add_action( ‘bp_setup_nav’, ‘my_remove_profile_nav’ );

    // Remove album menu tab in member profile
    function my_remove_album_nav() {
    if (!bp_is_my_profile()) {
    remove_action( ‘bp_setup_nav’, ‘bp_album_setup_nav’ );
    }

    }
    add_action( ‘bp_setup_nav’, ‘my_remove_album_nav’, 9 );

    Thanks for taking a look!

    #6283
     SQadmin
    Keymaster

    This hides the album, added to sweetdate-child/functions.php.
    You have the code above in a reply:

    COPY CODE
    
    function my_remove_album_nav() {
        if (!bp_is_my_profile()) {
            remove_action( 'bp_setup_nav', 'bp_album_setup_nav' );
        }
    }
    add_action( 'bp_setup_nav', 'my_remove_album_nav', 9 );
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #6284
     hughm
    Participant

    Great. That worked. Fat finger error on my part. Apologies.
    Thanks!

    #6871
     agentsrr
    Participant

    I’m still having problems removing the lower profile tab, I have been able to hide all other tabs except the profile and it’s been frustrating. If I give you access to my site can you take a look at what’s causing the problem?

    #6881
     agentsrr
    Participant

    Here is a pic https://www.dropbox.com/s/my27h00znhfl44w/IMG_20131118_173915.jpg as you can see all other tabs are hidden.

    #6909
     SQadmin
    Keymaster

    Hi, You should leave it like this and add this css to Sweetdate – Styling options – Quicks css to hide it:

    COPY CODE
    
    body:not(.my-account) #item-nav, body:not(.my-account) #item-body {
        display: none;
    }
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #6946
     agentsrr
    Participant

    Getting closer.. It works but hides everything now, you can’t edit the profile 🙁 how can I hide it but still edit if logged in?

    #6993
     SQadmin
    Keymaster

    Try the updated code.

    Cheers,
    Abe

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #7414
     aztlanla
    Participant

    That worked for me. It hides all the bottom navs for everyone, except for logged in user.

    #7842
     hughm
    Participant

    Is it possible to hide the Profile tab for everyone but the logged in user and the admin? As an admin I am unable to view new user buddypress profiles.

    #7872
     hughm
    Participant

    I think I figured it out:

    function my_remove_profile_nav() {
    global $bp;
    if (!bp_is_my_profile() && (!is_super_admin($user->ID))) {
    bp_core_remove_nav_item( 'profile' );
    }
    }
    add_action( 'bp_setup_nav', 'my_remove_profile_nav' );

    #7950
     Abe
    Keymaster

    Great 🙂

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #29325
     OkSeatbelts
    Participant

    The above code (post #5000) worked to remove the “Album” tab for all users except the logged in user, but I want to remove it for EVERYONE including the logged in user. How do I achieve this?

    #29808
     Abe
    Keymaster

    @OkSeatbelts Well you need basic PHP knowledge to make change to the templates. You should get rid of !bp_is_my_profile() &&

    Try collaborating with a developer for customizations

    Cheers

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #35895
     willianlima83
    Participant

    Hi
    Is there some code that hide the option ”ALBUMS” from the profile menu?

    I purchased rtMedia PRO but my customers says that the option ”ALBUM” and the option ”MEDIA” (from rtMedia) make it confuse.

    Then I’m trying to hide the option ALBUM only and leave only MEDIA (rtmedia) as option to upload photo albums.

    Can someone help me?

    #36369
     Abe
    Keymaster

    Disable bpAlbum from Sweetdate – Buddypress

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #36372
     willianlima83
    Participant

    Im in my mobile phone now and cant see any link..
    Is it a link? Lolol

    #36428
     willianlima83
    Participant

    OK.. I did.. thanks.

Viewing 39 posts - 1 through 39 (of 39 total)

The topic ‘Hide Profile tab’ is closed to new replies.

Log in with your credentials

Forgot your details?