-
Author
-
December 7, 2014 at 16:18 #37997ElismorParticipant
Hi,
I’d like to change the order of group tabs.
As you can see in the attached file, the order now is:Home|Forum|Membri|Manda inviti|Media|Gestisci
I’d like to have:
Forum|Membri|Home|Manda inviti|Media|Gestisciand I’d also like to change the name “Home” with “Novità”.
Is it possible?
Thank youAttachments:
You must be logged in to view attached files.December 7, 2014 at 16:36 #37999sharmstrModeratorhttp://shabushabu.eu/reordering-buddypress-group-tabs/
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
December 7, 2014 at 17:38 #38014ElismorParticipantHi Sharm, thank you.
I tried pasting the code in functions.php but it didn’t function.COPY CODEfunction shabushabu_change_group_tag_position() { global $bp; if ( $bp->current_component == $bp->groups->slug ) { $bp->bp_options_nav['groups']['home']['position'] = 20; $bp->bp_options_nav['groups']['home']['name'] = __( 'Activity', 'buddypress' ); if ( $bp->current_action == 'home' ) $bp->current_action = 'forum'; } } add_action( 'bp_init', 'shabushabu_change_group_tag_position' );
December 8, 2014 at 14:39 #38139sharmstrModeratorCouple of problems
1 – Normally home is position 10 and forum is position 20. In your code you are making home position 20, but not moving forum to position 10. That’s why you’re not seeing anything change, though technically, it has changed. Try this
COPY CODEfunction custom_group_nav() { global $bp; if (isset($bp->groups->current_group->slug) && $bp->groups->current_group->slug == $bp->current_item) { $bp->bp_options_nav[$bp->groups->current_group->slug]['forum']['position'] = 10; $bp->bp_options_nav[$bp->groups->current_group->slug]['members']['position'] = 20; $bp->bp_options_nav[$bp->groups->current_group->slug]['home']['position'] = 30; $bp->bp_options_nav[$bp->groups->current_group->slug]['home']['name'] = __( 'Novità', 'buddypress' ); } } add_action( 'bp_init', 'custom_group_nav', 100000 );
If you want to change the default tab to forum, you need to put this in your wp-config.php file.
COPY CODEdefine( 'BP_GROUPS_DEFAULT_EXTENSION', 'forum' );
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
-
AuthorPosts
The forum ‘General questions’ is closed to new topics and replies.