If you only have one group, then you can just hardcode the group name in the member-header.php file. Copy over this file from bp-default theme https://buddypress.trac.wordpress.org/browser/tags/1.5.5/bp-themes/bp-default/members/single/member-header.php into your theme i.e., wp-content/themes/YourThemeFolder/members/single/member-header.php
Open up member-header.php file and right beside
`<a href="”>` , add `(Microsoft)` for example
Hi mercime ,
Sorry i didn’t made my points clear…
I have for about 25 groups… but each member can join 1 group at most… Therefore i have 125 members and each group have 5 members…
Therefore i want to show the group name next to the user name of each member’s profile
thanks
I wrote some custom code which may help you out…..
`
$query = mysql_query(“SELECT * FROM bp_groups_members WHERE user_id = $user_id “);
$numrows = mysql_num_rows($query);
if ($numrows !=0 ){
$row = mysql_fetch_Assoc($query);
$group_id= $row; }
$query1 = mysql_query(“SELECT * FROM bp_groups WHERE id = $group_id “);
$numrows1 = mysql_num_rows($query1);
if ($numrows1 !=0 ){
$row1 = mysql_fetch_Assoc($query1);
$group_name= $row1; } `
and then just used following code to display the group name
`
()
`
This is exactly what i was looking for..
I hope this is the best solution for this feature???
@orpatech thanks for the solution. What exactly do we do with the MySQL code? where do I input it?
Thnks!