Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search members by username

  • Profile photo of footybible
    footybible
    Participant

    @footybible

    Buddypress search function only seems to look at actual names. Is there a way to enable searching by username?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Profile photo of lenasterg
    lenasterg
    Participant

    @lenasterg

    I don’t recommend to change the core files of buddypress. The best way to do it is to write a custom code (I don’t know how to guide you).
    So if you don’t mind changing the core files, here is a quick way.

    Open /buddypress/bp-core/bp-core-classes.php and change the
    $sql = “AND pd.value LIKE ‘%%$search_terms%%'”;
    to
    $sql = “AND (pd.value LIKE ‘%%$search_terms%%’ OR u.user_login LIKE’%%$search_terms%%’)” ;

    If someone can guide us how to do it in bp-custom.php, it would be great.

    Profile photo of Dipu
    Dipu
    Participant

    @dipuislam

    Thanks lenasterg. You are a gem.. worked perfect for me and this is what i needed :)

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Search members by username’ is closed to new replies.