BuddyDev

Search

BuddyPress Featured Members Suggestion

  • Participant
    Level: Enlightened
    Posts: 25
    Tiffany Phillips on #38407

    Hi,

    It would be great if in the widgets you could rearrange the order of members shown. Also to select by user role and select by individual member (as I want to charge for ad space).

  • Keymaster
    (BuddyDev Team)
    Posts: 21455
    Brajesh Singh on #38445

    Hi Tiffany,
    Thank you for the suggestion.

    1. Do you want to randomize the list? or do you want to control who appears first?
    2. We do have the ability to select by member type currently. We will be adding the role option in our future update.

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 25
    Tiffany Phillips on #38505

    1. To control who appears first
    2. Great, thanks!

  • Participant
    Level: Enlightened
    Posts: 33
    Mike OConnor on #44519

    I was wondering about this for a while. It would be FANTASTIC if we could add recently active to the alphabetical order. I want to reward the active members. Some of the featured members that start with
    “A” never log in.

  • Participant
    Level: Enlightened
    Posts: 33
    Mike OConnor on #44520

    Random would also be a GREAT option. The alphabetical one isn’t ideal. 🙂

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2435
    Ravi on #44523

    Hello Mike,

    Thank you for posting. Please try the following code:

    
    add_filter( 'bp_after_has_members_parse_args', function( $args ) {
    
    	if ( ! function_exists( 'bp_featured_members' ) ) {
    		return $args;
    	}
    
    	if ( bp_featured_members()->in_the_loop() || ( isset( $args['scope'] ) && $args['scope'] == 'featured' ) ) {
    		// Available options: Accepts 'active', 'random', 'newest', 'popular', 'online', 'alphabetical'.
    		$args['type'] = 'random';
    	}
    
    	return $args;
    }, 15 );
    
    

    You can put this code under the “bp-custom.php” file.

    For more info: https://buddydev.com/docs/buddypress-guides/what-is-bp-custom-php/

    Regards
    Ravi

  • Participant
    Level: Enlightened
    Posts: 33
    Mike OConnor on #44537

    Awesome, thanks!

You must be logged in to reply to this topic.

This topic is: not resolved