[Resolved] Returning friend connections of the current profile being viewed
[WP 3.5.2 / BP 1.8-beta1 / custom theme]
I am using the code below to display friend connections the member whose profile is being viewed:
<?php global $bp; $args = array( 'user_id' => $bp->displayed_user->id, 'max' => '30', 'type' => 'random' ); if ( bp_has_members( $args ) ) : ?> <ul id="members-list" class="item-list inline unstyled" role="complementary"> <?php while ( bp_members() ) : bp_the_member(); ?> <li><a href="<?php bp_member_permalink(); ?>"><?php bp_member_avatar(); ?></a></li> <?php endwhile; ?> </ul> <?php endif; ?>
Once I added this, I think the global $bp; slowed down my page load by quite a bit. Since we are already on a member profile page, is there any way to grab the current displayed user’s ID instead of running the global $bp?
You must be logged in to reply to this topic.