Skip to content

Template Overrides

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 (public single list page).
  • all-lists.php (a member’s lists).
  • public-list.php.
  • buddylists-list-creation.php (list creation form).
  • buddylists-followed-lists.php (followed lists view).

BuddyLists also registers two widgets you can place in any widget area:

  • Buddylists Active Members (Buddylists_Active_Members_Widget).
  • Buddylists Members Lists (Buddylists_Members_Lists_Widget).