Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • @gingram815

    Member

    I found a solution which works pretty well. You can pass parameters in addition to the bp_ajax_querystring. Here is my example:
    if ( bp_has_members(bp_ajax_querystring( 'members').'&type=alphabetical&exclude='.$value) ) : ?>

    The only problem is the parameter “include” does not work. This basically says only list these members and no others. That negates the bp_ajax_querystring() function so filters do not work. But you can use “exclude” as this only modifies the list returned by bp_ajax_querystring() and then filters work. As you can see from my example, you can also use type=alphabetical to automatically make the list alphabetical instead of by activity. Hopefully this helps someone.

    @gingram815

    Member

    I am having the exact same issue. I tried modifying bp_has_members but I can’t figure out how to integrate with bp_ajax_querystring( ‘members’).
    `<?php

    $twamembers = get_users(‘role=s2member_level1&fields=ID’);
    $admin = get_users(‘role=administrator&fields=ID’);
    $role_ids=array_merge($twamembers,$admin);
    $value=implode(‘,’,$role_ids);

    if ( bp_has_members(‘type=alphabetical&include=’.$value) ) : ?>`
    The above code returns the members I want in the member directory, but then I cannot search the directory. Does anyone know how to either search the member directory without the ajax or integrate the above with the ajax so they work together?

    @gingram815

    Member

    Have any solutions been made for this? I would like to have custom parameters such as “if ( bp_has_members( ‘type=alphabetical&include=’.$user_id) )” but then none of the searches work. Any way to either get searches to work with custom parameters, insert my custom parameters into bp_ajax_querystring(), or add another filter that is on all the time?

    I have WP 3.2.1/BP 1.5. I am using the BP-default theme.

    @gingram815

    Member

    It seems the “bp-get-members-root-slug() function is working just fine as the same problem exists even if I manually put in the url which should reload the members directory (and show all members), it still does not reload the whole page, only the members list. Since it does not reload the whole page, the search does not get cleared and only the members that met the search criteria are loaded. Any idea how to reload the whole page?

    @gingram815

    Member

    Okay, I figured out how to do it using another post of yours:
    `<?php
    function member_loop_profession_link(){
    $data = bp_get_member_profile_data( ‘field=Profession’ );
    if ( $data ){
    $sandata = sanitize_title_with_dashes($data);
    echo “

    “;
    }
    }
    add_action( ‘bp_directory_members_item’, ‘member_loop_profession_link’ );

    ?>`
    This is placed in functions.php.
    It works like a charm; thank you so much.

    Glenn

    @gingram815

    Member

    That is likely the problem. I’m not a coder.
    I have tried a variety of markups. Here is an example:
    `

    `
    This returns the link unsanitized (ex: http://transylvaniawellnessalliance.com/wellness-businesses/Naturopathic Doctor).

Viewing 6 replies - 1 through 6 (of 6 total)
Skip to toolbar