Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author r-a-y

    (@r-a-y)

    It’s a problem with your theme.

    The theme needs to add the following line somewhere in the members-loop.php file:

    <?php do_action( 'bp_directory_members_actions' ); ?>

    Thread Starter solojuve1897

    (@solojuve1897)

    @r-a-y

    I don’t have that line in the members-loop.php file. I can find the following there though:

    <div class="item-list search-list" id="members-list">
        <?php while ( bp_members() ) : bp_the_member(); ?>
    
          <div class="four columns">
            <div class="search-item">
              <div class="avatar">
                <a href="<?php bp_member_permalink(); ?>"><?php bp_member_avatar('type=full&width=94&height=94&class='); ?></a>
                <?php do_action('bp_members_inside_avatar');?>
              </div>
                <?php do_action('bp_members_meta');?>
              <div class="search-body">
                  <?php do_action( 'bp_directory_members_item' ); ?>
              </div>
              <div class="bp-member-dir-buttons">
              <?php do_action('bp_directory_members_item_last');?>
              </div>
            </div>
          </div>
    
        <?php endwhile; ?>
      </div>

    In the bp-functions.php file I can then find the following with regards to “item_last”:

    add_action('bp_directory_members_item_last','kleo_bp_member_dir_view_button', 10);
    
    if (! function_exists('kleo_bp_member_dir_friend_button')):
      /**
       * Render add friend button on members directory
       */
      function kleo_bp_member_dir_friend_button()
      {
        add_filter('bp_get_add_friend_button', 'kleo_change_profile_button');
        bp_add_friend_button(bp_get_member_user_id());
      }
    endif;
    if ( bp_is_active( 'friends' ) ) {
      add_action('bp_directory_members_item_last','kleo_bp_member_dir_friend_button', 11);
    }

    Do you have any idea what’s going on and what I could do? I actually don’t want the “add friend”-button on that specific page where the members are listed. I just need the “View profile”-button (which I already have) and the follow-button from this plugin.

    I appreciate the help.

    Regards,

    Plugin Author r-a-y

    (@r-a-y)

    Try:

    if ( bp_is_active( 'follow' ) ) {
    	add_action( 'bp_directory_members_item_last', 'bp_follow_add_listing_follow_button' );
    }
    Thread Starter solojuve1897

    (@solojuve1897)

    @r-a-y

    It works like a charm. Thank you very much. Just a styling issue left. The friends button (which I now have removed completely) had the following styling:

    if (! function_exists('kleo_bp_member_dir_friend_button')):
      /**
       * Render add friend button on members directory
       */
      function kleo_bp_member_dir_friend_button()
      {
        add_filter('bp_get_add_friend_button', 'kleo_change_profile_button');
        bp_add_friend_button(bp_get_member_user_id());
      }
    endif;
    if ( bp_is_active( 'friends' ) ) {
      add_action('bp_directory_members_item_last','kleo_bp_member_dir_friend_button', 11);
    }
    
    if (!function_exists('kleo_change_profile_button')):
      /**
       * Change default BP button class and text next to profile in members directory
       * @param array $button
       * @return array
       */
      function kleo_change_profile_button($button)
      {
          $is_friend = bp_is_friend( bp_get_member_user_id() );
    
          if ( empty( $is_friend ) )
            return false;
    
          switch ( $is_friend ) {
            case "pending":
            case "is_friend":
              $button['link_text'] = '<i class="icon-minus"></i>';
              break;
            default:
              $button['link_text'] = '<i class="icon-plus"></i>';
              break;
          }
    
        $button['link_class'] = 'button small secondary radius';
        return $button;
      }
    endif;

    Is it possible to make the follow-button behave in the same manner? Or at least change its class to “button small secondary radius”?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Missing follow-button on Members-page’ is closed to new replies.