Include a 'Members of my groups'-view in the index.php of members
-
Hi there,
actually I use child-theme, based on the bp-default-Theme.
I have added a new site, where I list all members of the groups, which the user is member of.
Unfortunately, I don´t know how I could insert this view in the members/index.php of my child-theme. Actually I use link from the index.php to a separate site of wordpress. The Problem is, all items of the navigation are “lost” and a further site is not very user-friendly.
Every works fine. But is there any chance to include this directly in my index.php of the child-theme?The link in theme/buddypress/members/index.php of my child-theme
<li id="members-my"><a href="/vereinfaches/vereinskollegen/" class="no-ajax-customlink"><?php printf( __('Meine Vereinskollegen') ) ?></a></li>
The code in the template of my new site:
<div id="buddypress"> <?php $user_id = bp_loggedin_user_id(); $groups = $wpdb->get_col($wpdb->prepare("SELECT group_id FROM {$wpdb->prefix}bp_groups_members WHERE user_id = %d",$user_id),0); global $wpdb; $allUsers = $wpdb->get_col($wpdb->prepare("SELECT DISTINCT user_id FROM {$wpdb->prefix}bp_groups_members WHERE group_id IN (".implode(', ', array_fill(0, count($groups), '%s')).")",$groups),0); if ( bp_has_members( array( 'include' => $allUsers ) ) ) : ?> <div id="member-count" class="pag-count"> <?php bp_group_member_pagination_count() ?> </div> <div id="member-pagination" class="pagination-links"> <?php bp_group_member_pagination() ?> </div> <ul id="member-list" class="item-list"> <?php while ( bp_group_members() ) : bp_group_the_member(); ?> <li> <div class="item-avatar"> <a href="<?php bp_member_permalink(); ?>"><?php bp_member_avatar(); ?></a> </div> <div class="item"> <div class="item-title"> <a href="<?php bp_member_permalink(); ?>"><?php bp_member_name(); ?></a> <?php if ( bp_get_member_latest_update() ) : ?> <span class="update"> <?php bp_member_latest_update(); ?></span> <?php endif; ?> </div> <div class="item-meta"><span class="activity"><?php bp_member_last_active(); ?></span></div> </li> <?php endwhile; ?> </ul> <?php endif; ?> </div><!-- #buddypress -->
- The topic ‘Include a 'Members of my groups'-view in the index.php of members’ is closed to new replies.