Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)

  • 2paulm
    Participant

    @2paulm

    shane thank you for your help I figured it out while I was waiting and used this function

    I added this to members-loop.php

    if ( bp_has_members( include_only_subscribers() ) ) :

    and added this to my themes function.php

    function include_only_subscribers() {
      
      global $wpdb;  
    
        $query = "SELECT user_id FROM " . $wpdb->prefix . "bp_xprofile_data WHERE user_id IN (SELECT user_id FROM wp_usermeta WHERE meta_value LIKE '%subscriber%')";
      
      $custom_ids = $wpdb->get_col( $query );
      
      if ( !empty( $custom_ids ) ) {
        // convert the array to a csv string
        $custom_ids_str = 'include=' . implode(",", $custom_ids);
        return $custom_ids_str;
      }
      else
       return '';
    }

    it seems to be working I just used some info from https://codex.buddypress.org/developer/loops-reference/the-members-loop/

    and modified to meet my needs.

    please let me know if you see any problem with my approach and thank you so much for your response and help with this


    2paulm
    Participant

    @2paulm

    Anyone? please help if you can

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