BuddyPress featured Members plugin allows site admins to mark users as featured and display the list of featured users as list or slider.
- 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.
Marking User as featured Members:-
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:-
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' );
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).
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.