BuddyDev

BuddyPress Featured Members

BuddyPress featured Members plugin allows site admins to mark users as featured and display the list of featured users as list or slider.

Features:-

  • Multiple users can be marked as featured
  • Featured Members can be displayed using shortcode or widget
  • You can use multiple widget/shortcodes
  • Each shortcode/widget can be displayed as a list or a slider of users.
  • A default theme view for members list is also supported, It lists the members using members-loop.php from your theme
  • Members list can be easily customized( See custom view section below )
  • Featured Members Can be displayed in the directory too(It can be disabled using a filter)
  • Easy API for marking a user as featured/removing user from the list of featured members.

Screenshots:-

 

If you are the site admin, you can mark user as featured member from the members directory list or from the user profile. You can remove the users from the list using the same way.

Displaying Features BuddyPress Members using Widget:-

Please visit Dashboard->Appearance->Widgets

Add the BuddyPress Featured Members widget to your sidebar. You can specify title, maximum no. of users to show and the user list view as shown below:-

Three views are supported

  • List:- users are displayed as unordered list
  • Slider:- List is displayed as slider with individual members as slider(Shortcode supports multiple members per slide, we will add to widget settings in future)
  • Theme Default:- Instead of custom list/slider, it uses the members/members-loop.php for listing the users

Displaying the Featured Members List using Shortcode:-

[bp-featured-members]

You can use the above shortcode to display the featured members in your posts/page. The shortcode supports following options:-

view(string):- It controls the display of the members list. Possible values are 'list', 'slider', 'default'. Default 'list'.

  • list:- the members are displayed as un ordered list
  • slider:- the members are displayed as slider with one or more member per slide
  • default:- Uses theme's default member list view( members/members-loop.php)

max (int):- It limits the maximum number of users displayed in the list. default 5.

member_type(string):- Filter featured list by member type.

avatar_size(number):- Specify a number as avatar size(e.g 50 means 50px).

The following options in the shortcode are only meaningful if view=slider

slide-item (int) :- How many members to display per slide. default 1.

slide-slideMargin (int):- Margin between two slides. default 0.

slide-mode (string):- How the slides transition works. Possible values are 'slide', 'fade'. Default 'slide.

slide-speed (int):- slide transition speed. default 400.

slide-auto (int):- Whether to auto start slide. Default 1. Possible values are 0, 1.

slide-pauseOnHover (int):- Whether to pause slider on mouseover. Default 0.

slide-controls (string):- Whether to display pre/next slide control or not.

slide-loop (int):- Whether to loop back to the beginning the slides when reached the last element.

BuddyPress Featured Members plugin API:-

In case you want to add/remove/check featured members. We have got you covered.

Mark a user as featured member:-

bp_featured_members()->add_user( $user_id );

Remove a User from the featured members list:-

bp_featured_members()->remove_user( $user_id );

Check if a user is featured member:-

bp_featured_members()->is_featured( $user_id );

Get total count of featured members:-

$count = bp_featured_members()->get_count();

Forcing BuddyPress Members list to display featured members:-

All you need to do is pass scope=featured to bp_has_members()

Directory tab disabling:-

To disable Featured Members tab in members directory, please put the following code in bp-custom.php or the functions.php of your theme.

add_filter( 'bp_featured_members_display_directory_tab', '__return_false' );

Template Customization:-

Most of the time you won't need to do it. In case you want to add more information to the members list/slide etc, you can easily do that in a future proof way.

Customize template files for listing featured members:-

You can override the template used for displaying featured members list/slider in your theme/child theme.

Widget:-
    view:- list checks for
        - current_theme/(buddypress/)members/featured/widget/members-loop-list.php
        - current_theme/(buddypress/)members/featured/members-loop-list.php

        - plugins/bp-featured-members/template/members-loop-list.php

  view:- slider checks for
        - current_theme/(buddypress/)members/featured/widget/members-loop-slider.php
        - current_theme/(buddypress/)members/featured/members-loop-slider.php

        - plugins/bp-featured-members/template/members-loop-slider.php

Shortcode:-
    view:- list checks for
        - current_theme/(buddypress/)members/featured/shortcode/members-loop-list.php
        - current_theme/(buddypress/)members/featured/members-loop-list.php

        - plugins/bp-featured-members/template/members-loop-list.php

  view:- slider checks for
        - current_theme/(buddypress/)members/featured/shortcode/members-loop-slider.php
        - current_them/(buddypress/)members/featured/members-loop-slider.php

        - plugins/bp-featured-members/template/members-loop-slider.php

where bracket () means that part is optional and will depend on your theme. We suggest to follow the convention of your theme.

If you need to modify the template files,  is recommended to copy the template files from plugin(or at least look at the structure).

Troubleshooting:-

Problem:– The featured members list is empty.

Solution:– Please check if you have marked any member as featured member. If yes, Please report it on BuddyDev Forum

Credits:- We use the light Slider jQuery plugin by Sachin while the slider view is used.

Release History

  • Version: 1.1.3

    Tuesday, 06 September, 2022
    • Tested With: BuddyPress 10.4.0
    • Compatible With: BuddyPress 8.0+

    minor enhancement to allow type based filtering when the code is used manually.

  • Version: 1.1.1

    Monday, 28 June, 2021
    • Tested With: BuddyPress 8.0.0
    • Compatible With: BuddyPress 6.0+

    Fix translations.
    Better code indentation.

  • Version: 1.1.0

    Saturday, 16 June, 2018
    • Tested With: BuddyPress 3.1
    • Compatible With: BuddyPress 2.5+

    Fix the slide options in widget.

  • Version: 1.0.9

    Saturday, 16 June, 2018
    • Tested With: BuddyPress 3.1
    • Compatible With: BuddyPress 2.5+

    Added more control for widget slider options.

  • Version: 1.0.7

    Saturday, 21 April, 2018
    • Tested With: BuddyPres 2.9.4
    • Compatible With: BuddyPress 2.5+

    Fix translation file name.

  • Version: 1.0.6

    Monday, 01 January, 2018
    • Tested With: BuddyPress 2.9.2
    • Compatible With: BuddyPress 2.5+

    Escape title attributes in the list.

  • Version: 1.0.5

    Sunday, 31 December, 2017
    • Tested With: BuddyPress 2.9.2
    • Compatible With: BuddyPress 2.5+

    Updated to add avatar size.

  • Version: 1.0.3

    Sunday, 08 October, 2017
    • Tested With: BuddyPress 2.9.1
    • Compatible With: BuddyPress 2.5+

    Fix default theme layout option not honouring the settings.

  • Version: 1.0.2

    Monday, 27 February, 2017
    • Tested With: BuddyPress 2.8.1
    • Compatible With: BuddyPress 2.5+

    Allow filtering by member types.

  • Version: 1.0.1

    Sunday, 08 January, 2017
    • Tested With: BuddyPress 2.5+
    • Compatible With: Fix the translation path

    Fix translation path

  • Version: 1.0.0

    Friday, 06 January, 2017
    • Tested With: BuddyPress 2.7.4
    • Compatible With: BuddyPress 2.5+

    Initial release.