Skip to content

Template Overrides

BuddyLists overviewPremiumGet BuddyLists →

BuddyLists loads its front-end templates through buddylists_locate_template(), which lets a theme override any template without editing the plugin.

For a template file name, buddylists_locate_template() looks in this order:

  1. wp-content/themes/<active-theme>/buddylists/<file> (child theme / active stylesheet).
  2. wp-content/themes/<parent-theme>/buddylists/<file> (parent theme).
  3. The plugin’s own templates/<file>.

The first match wins. To override a template, copy it from the plugin’s templates/ folder into a buddylists/ folder inside your theme and edit the copy.

You can also change the resolved path programmatically:

add_filter(
'buddylists_locate_template',
function ( $template_part, $file_name ) {
if ( 'single-list.php' === $file_name ) {
$template_part = '/absolute/path/to/your/single-list.php';
}
return $template_part;
},
10,
2
);

These files live in the plugin’s templates/ folder and can each be overridden:

  • single-list.php (the list page: banner, Feed, Members and Followers views, and the Add people panel).
  • all-lists.php (the lists a member owns, on the Lists tab).
  • buddylists-list-creation.php (the create and edit list window).
  • buddylists-delete-dialog.php (the Confirm Delete window).
  • buddylists-followed-lists.php (the My Followed Lists view).

BuddyLists registers two widgets and two widget areas. The widgets appear only on a list page, and show nothing on a list the visitor cannot open.

  • (Buddylists) Buddylist Active Members (Buddylists_Active_Members_Widget) shows people on the viewed list who were active in the last 30 days. The window can be changed with the buddylists_active_member_window_days filter.
  • (Buddylists) Buddylist Members (Buddylists_Members_Lists_Widget) shows the people on the viewed list, newest registered first.

Each widget has a Title and a Member Limit (default 5). The widget areas are BuddyLists Left Sidebar and BuddyLists Right Sidebar, and both are shown on the list page. On a very large list the widgets look at the 500 newest memberships. The buddylists_widget_member_ceiling filter changes that number.