This topic has 38 replies, 9 voices, and was last updated 10 years by willianlima83.
-
Author
-
October 22, 2013 at 22:20 #4908agentsrrParticipant
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
October 23, 2013 at 01:34 #4935SQadminKeymasterSo 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 solutionOctober 23, 2013 at 05:56 #4947adamParticipantHi 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!
October 24, 2013 at 00:25 #5000SQadminKeymasterHi, This way it works:
COPY CODEfunction 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 solutionOctober 24, 2013 at 00:53 #5002agentsrrParticipantWell 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??
October 24, 2013 at 18:37 #5050SQadminKeymasterYou 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 CODEfunction 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 solutionOctober 24, 2013 at 19:27 #5059siegluferParticipantFollowing 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.
October 24, 2013 at 19:58 #5061adamParticipantHi @seiglufer – This is how I removed the entire bottom navigation in functions.php:
COPY CODEfunction 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.
October 25, 2013 at 00:03 #5074agentsrrParticipantI 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.
October 25, 2013 at 00:20 #5078adamParticipant@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.
October 25, 2013 at 00:50 #5079agentsrrParticipantHi 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
October 25, 2013 at 00:57 #5081adamParticipantfunction 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’ );October 25, 2013 at 02:04 #5096agentsrrParticipantI’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?
October 26, 2013 at 03:34 #5151SQadminKeymasterYou 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 solutionOctober 28, 2013 at 13:08 #5246siegluferParticipantI 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?
October 28, 2013 at 17:37 #5281SQadminKeymasterSee 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 solutionNovember 5, 2013 at 23:43 #6053agentsrrParticipantI’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!
November 6, 2013 at 19:15 #6099SQadminKeymasterSee 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 solutionNovember 7, 2013 at 17:50 #6192hughmParticipantI 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!
November 8, 2013 at 20:23 #6283SQadminKeymasterThis hides the album, added to sweetdate-child/functions.php.
You have the code above in a reply:COPY CODEfunction 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 solutionNovember 8, 2013 at 20:29 #6284hughmParticipantGreat. That worked. Fat finger error on my part. Apologies.
Thanks!November 19, 2013 at 01:35 #6871agentsrrParticipantI’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?
November 19, 2013 at 03:46 #6881agentsrrParticipantHere is a pic https://www.dropbox.com/s/my27h00znhfl44w/IMG_20131118_173915.jpg as you can see all other tabs are hidden.
November 19, 2013 at 13:10 #6909SQadminKeymasterHi, You should leave it like this and add this css to Sweetdate – Styling options – Quicks css to hide it:
COPY CODEbody: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 solutionNovember 19, 2013 at 20:10 #6946agentsrrParticipantGetting closer.. It works but hides everything now, you can’t edit the profile 🙁 how can I hide it but still edit if logged in?
November 21, 2013 at 01:45 #6993SQadminKeymasterTry the updated code.
Cheers,
AbeHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionNovember 28, 2013 at 08:43 #7414aztlanlaParticipantThat worked for me. It hides all the bottom navs for everyone, except for logged in user.
December 7, 2013 at 07:26 #7842hughmParticipantIs 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.
December 7, 2013 at 16:32 #7872hughmParticipantI 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' );December 9, 2013 at 12:30 #7950AbeKeymasterGreat 🙂
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.September 23, 2014 at 09:21 #29325OkSeatbeltsParticipantThe 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?
September 26, 2014 at 12:03 #29808AbeKeymaster@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.November 18, 2014 at 19:40 #35895willianlima83ParticipantHi
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?
November 22, 2014 at 14:17 #36369AbeKeymasterDisable 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.November 22, 2014 at 14:34 #36372willianlima83ParticipantIm in my mobile phone now and cant see any link..
Is it a link? Lolol -
AuthorPosts
The topic ‘Hide Profile tab’ is closed to new replies.