Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Help with new function


Jeff Sayre
Participant

@jeffsayre

Okay, several issues to discuss here:

  1. I created a new function in wpmu-functions.php

    Why modify a core WPMU file to be used in a BuddyPress theme file? Instead, create this function in your bp-custom.php file. That why, when you upgrade BP, your changes will not be lost–assuming that you do not delete your bp-custom.php file.

  2. The user ID field does not contain string content. So:

    u.ID = %s

    should be

    u.ID = %d

  3. What you are after is grabbing a member’s ID and then using that to pull their login name (username). I don’t think that the variable $username is available for the function call–at least not the way you are trying to reference it. I would use this instead:

    $bp->displayed_user->id

    You will need to declare bp as global in your members-loop.php file.

Skip to toolbar