That’ll probably only work when used inside a Groups template loop. Where are you putting this?
Also do not want the groups component url/slug either
inside a groups sub nav tab. so that should be in the groups template loop.
any ideas?
Johnny
So, inside a group template, how do you get the current group slug?
Thanks,
Johnny
bp_get_current_group_slug() gets the slug for the current viewed group ($bp->groups->current_group->slug). For instance, in this group, it would return
`how-to-and-troubleshooting`
bp_get_group_slug() gets the slug of the group when you’re inside of a group loop ($groups_template->group->slug).
BAM !!!!!!!!!
bp_get_current_group_slug()
thanks
Johnny
crap.
This is the same problem. When running BP Group Hierarchy the function bp_get_current_group_slug() actually returns the slug for the hierarchy and the current group.
ie: development/public/modded-splog
I just want modded-splog
Is this possible?
BTW bp_get_current_group_slug() does return the correct slug when the group is root (not a sub group when BP Group Hierarchy is used).
Cheers,
Johnny
@ddean
Any ideas on how to return the current group slug only. not the rest of the hierarchy?
Cheers
Johnny