Search Results for 'bp_get_displayed_user_nav'
-
AuthorSearch Results
-
September 8, 2010 at 12:11 am #91815
thekmen
Participanthave it placed in functions.php correctly, time to start deactivating plugins to see why it isn’t working…
September 7, 2010 at 7:23 pm #91808Hugo Ashmore
ParticipantI’ve had issues, not convinced there isn’t something gremlin like at work here, and yes think I’ve worked out stuff must go after the <?php thingamajig
as for case sensitive is that ‘Attache’ or ‘Briefcase’September 7, 2010 at 6:59 pm #91805Boone Gorges
KeymasterEither you haven’t placed the function in the right place (should go right after the `<?php ` in your theme's functions.php), or you're not correctly referencing the nav items. Remember that they're case-sensitive.
September 7, 2010 at 5:52 pm #91795thekmen
Participant@boonebgorges can you think of any reason your function for removing nav items wouldn’t work?
I’m using latest 1.2 branch & can’t remove any nav items.September 7, 2010 at 4:43 pm #91790Boone Gorges
KeymasterAwesome, thanks Roger!
September 7, 2010 at 3:32 pm #91784Roger Coathup
ParticipantThe other thread, with code for the number of messages / notifications, and link across is: https://buddypress.org/community/groups/installing-buddypress/forum/topic/hi-hi-everyone-how-can-i-get-the-message-url-or-the-number-of-messages-and-settings-url/
September 7, 2010 at 2:03 pm #91779Boone Gorges
Keymaster@ri-kun The answer to your second question is not straightforward, though it has been discussed before on this forum. I suggest posting it in another thread so that other users will be able to help you with it. You might also have a look at this plugin by @pollyplummer https://wordpress.org/extend/plugins/buddypress-sliding-login-panel/
September 7, 2010 at 12:18 pm #91764ri-kun
ParticipantThanks for the response @Boone Gorges
Can you also please please please answer the 2nd question?:
2. This is an off topic but I wanted to get the code for the “Message”. I mean I wanted to put the link of the messages on each users sidebar. Like they can see anywhere they go in the site their message link, if theres a new message or not. Thanks in advance.
I wanted to transfer the links SETTING, FRIENDS, GROUPS and QUICKPOST in the sidebar but dont know where to get the codes from the nav to the sidebar.
September 7, 2010 at 11:51 am #91760Boone Gorges
Keymaster@blogmudgeon Glad to help

@ri-kun bp_core_remove_nav_item doesn’t take multiple arguments. Try something like:
`<?php function boone_remove_blogs_nav() {
bp_core_remove_nav_item( ‘blogs’ );
bp_core_remove_nav_item( ‘groups’ );
}
add_action( ‘bp_setup_nav’, ‘boone_remove_blogs_nav’, 15 ); ?>`Add additional lines for nav items you want to remove. And make them lowercase, as the names might be case-sensitive and they are almost certainly lowercase when they are initially added.
functions.php, in your theme directory, is the appropriate place to put this. There should be no function called bp-functions.php.
September 7, 2010 at 4:05 am #91731ri-kun
Participantwait, I tried to add this on my bp-functions.php and functions.php but it didnt remove anything from the nav:
`<?php function boone_remove_blogs_nav() {
bp_core_remove_nav_item( ‘Profile’,’Blogs’,’Quick Post’,’Messages’,’Friends’,’Groups’,’Points’,’Settings’ );
}
add_action( ‘bp_setup_nav’, ‘boone_remove_blogs_nav’, 15 ); ?>`September 7, 2010 at 3:51 am #91729PapaTango
MemberAnd that Sir, just brought my community site one step closer to production! I may not be a programmer, but I have had the good fortune of encountering many gracious ones across the years willing to help the hapless, hopeless, and helpless amongst the publisher ranks. Thank you!
If you ever have issues with amateur radio gear, don’t hesitate to ask me…

P
September 7, 2010 at 3:46 am #91728ri-kun
ParticipantAnd also regarding no.2 I wanted to transfer the links SETTING, FRIENDS, GROUPS and QUICKPOST in the sidebar but dont know where to get the codes from the nav to the sidebar.
September 7, 2010 at 3:41 am #91727ri-kun
Participant1. How about you want to remove more than one? what additional codes you need to add?
2. This is an off topic but I wanted to get the code for the “Message”. I mean I wanted to put the link of the messages on each users sidebar. Like they can see anywhere they go in the site their message link, if theres a new message or not. Thanks in advance.
September 6, 2010 at 4:25 pm #91667Boone Gorges
KeymasterThe following function, placed into your theme’s functions.php or bp-custom.php file, will remove the Blogs nav item from the Members section of the site:
`function boone_remove_blogs_nav() {
bp_core_remove_nav_item( ‘blogs’ );
}
add_action( ‘bp_setup_nav’, ‘boone_remove_blogs_nav’, 15 );`Other top-level nav items can be removed by replacing ‘blogs’ with the appropriate name. Subnav items will work in a similar way, except using `bp_core_remove_subnav_item` and the extra $parent_id argument:
`function boone_remove_friends_activity_nav() {
bp_core_remove_subnav_item( ‘activity’, ‘friends’ );
}
add_action( ‘bp_setup_nav’, ‘boone_remove_friends_activity_nav’, 15 );`September 6, 2010 at 2:28 pm #91660PapaTango
MemberSorry to say, a lot of us on the end publishing equation are not programmers… I used EngineSite to find the string, but have no clue as to where the parent ID for the menu item is to be found. even then, is it simply a matter of entering that ID into the argument?
‘/**
* bp_core_remove_nav_item()
*
* Removes a navigation item from the sub navigation array used in BuddyPress themes.
*
* @package BuddyPress Core
* @param $parent_id The id of the parent navigation item.
* @param $slug The slug of the sub navigation item.
*/
function bp_core_remove_nav_item( $parent_id ) {
global $bp;/* Unset subnav items for this nav item */
if ( is_array( $bp->bp_options_nav[$parent_id] ) ) {
foreach( (array)$bp->bp_options_nav[$parent_id] as $subnav_item ) {
bp_core_remove_subnav_item( $parent_id, $subnav_item );
}
}unset( $bp->bp_nav[$parent_id] );’
Thanks!
P
September 5, 2010 at 10:21 pm #91626Boone Gorges
KeymasterRoger’s right – bp_core_remove_nav_item() is the function you want. See bp-core.php to see how that function works.
Also, please don’t bump your question more than once every few days. This board is not so well-trafficked that you can expect an answer to every question within a few hours, especially on the weekend.
September 5, 2010 at 10:10 pm #91625Roger Coathup
ParticipantYou could look at adding a filter on: bp_get_displayed_user_nav_ . $user_nav_item to remove the blog menu.
Or, take a look at these functions in bp-core.php:
function bp_core_new_nav_item( $args = ” )
function bp_core_remove_nav_item( $parent_id )September 5, 2010 at 7:42 pm #91621ri-kun
Participanthelp please….help please….help please….
September 5, 2010 at 4:10 am #91581ri-kun
Participanthelp please….help please….help please….
August 20, 2010 at 8:29 am #89790Sandra l***
Participant(appended here so that other participants can read the answer)
In reply to your message saying that you still don’t see the tab in the subnav, I could be wrong but I would be inclined to think that your problem is not caused by the WP/BP versions (I am running the latest ones) but by the theme you are using.
The “Events” nav is posted in the member profile through this call (in bp-events.php)
/* Add ‘Events’ to the main navigation */
bp_core_new_nav_item( array( ‘name’ => __(‘Events’, ‘bp-events’), ….. [stuff removed here]In order for this to work, your theme (wp-contentthemesyour-theme-herememberssinglehome.php) should contain this call in the “right” place
bp_get_displayed_user_nav()
e.g. If I take this line away from my theme (I decided to turn a regular WP theme into a BP compliant theme thanks to BuddyPress Template Pack), then the “Events” tab no longer shows up (and a few others disappear too).
So you might want to verify your theme. Is it truly BP-compliant?
July 20, 2010 at 10:38 am #86243sicksight
ParticipantYour Code worked, but disables all navigations (adminbar….).
I will remove the calls in my child theme, because it is the easyest way!Thanks for information guys!
July 19, 2010 at 8:34 pm #86193r-a-y
KeymasterYou can’t remove it as an action, since bp_get_displayed_user_nav() is a template tag and not an actionable item.
If you’re using a child theme, remove the calls to bp_get_displayed_user_nav() or try hiding the menu via CSS.*Edit – Just thought of a sneaky way of doing this.
Add the following to your theme’s functions.php:
http://buddypress.pastebin.com/90L4iKveJuly 19, 2010 at 6:13 am #86116modemlooper
Moderatorthe other fix is to change the function in the BP functions file. You’d have to keep track of that change on upgrades to BP. I still think you can remove it via remove_action.
@r-a-y can you help at all?
July 17, 2010 at 7:35 pm #86040sicksight
ParticipantYes, I could do this, but then I must update my code after every plugin update (gallery, … )… When there is no remove_action possible, I must remove the line in the theme files…
July 17, 2010 at 5:20 pm #86036modemlooper
ModeratorWhy not just remove the code directly from the template file?
-
AuthorSearch Results