BuddyDev

Search

[Resolved] Members page count doesn’t match what’s listed

  • Participant
    Level: Enlightened
    Posts: 55
    la on #55336

    Hey there,
    I’m using the code you posted to hide admin role and certain ids from being displayed in the Members Directory you posted here…
    https://buddydev.com/hiding-users-on-buddypress-based-site/
    Thanks for that, very useful!
    But when I look at the members page either as admin or as a user, the little bubble that says how many members there are is off by one, it says there is one more than is being displayed.
    Any idea what would cause that behaviour?
    Thanks

  • Participant
    Level: Enlightened
    Posts: 55
    la on #55337

    I did set a few test users to be hidden in the members directory but then it doesn’t seem like they would be included in the count?

  • Keymaster
    (BuddyDev Team)
    Posts: 24968
    Brajesh Singh on #55341

    Hi,
    Thank you for the question.

    You are right about the count. BuddyPress uses separate query for the total count and the members directory user listing.

    That makes it complicated to have synchronized counts.

    There is a solution by filtering bp_core_get_active_member_count and removing the no. of excluded users count from it but it is not a good solution.

    Can you share e your code here or pastebin, I may be able to assist by providing code for count synchronization.

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 55
    la on #55344

    Hi Brajesh,
    Thanks as always for your thoughtful and quick response.

    I’m using the code that you supplied in the link
    https://buddydev.com/hiding-users-on-buddypress-based-site/

    The first two…the one for ids and the one for roles.

    I suppose the other option might be just to hide the count entirely?

    Thanks again.

  • Keymaster
    (BuddyDev Team)
    Posts: 24968
    Brajesh Singh on #55348

    Hi La,
    Thank you.
    Using the css to hide count is a better and simple option here.

    Are you using BP legacy or BP Nouveau template pack?

    Please let me know and I will assist.

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 55
    la on #55352

    Thanks. I’m using BP Nouveau.

  • Keymaster
    (BuddyDev Team)
    Posts: 24968
    Brajesh Singh on #55353

    Thank you for the details.

    Please use the following css.

    
    #members-all .count {
        display: none;
    }
    
    

    Let me know if it worked or not?

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 55
    la on #55356

    Thanks. It worked for the bubble but it still had
    Viewing 1 – 5 of 5 active members
    At the top and the bottom.
    I added this and it’s gone now.

    .buddypress-wrap .bp-pagination {
    display:none!important;}

    Thanks again!

  • Keymaster
    (BuddyDev Team)
    Posts: 24968
    Brajesh Singh on #55362

    Thank you. I am glad it helped and you were able to resolve the pagination on your own.

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: resolved