Skip to content

Using custom templates

r-a-y edited this page Apr 12, 2013 · 1 revision

v1.2

In v1.2, you can override the template that comes with the plugin by copying /wp-content/plugins/buddypress-followers/_inc/templates/buddypress/ to your WordPress theme.

So, for example, if I have a WP theme called Child Theme located at: /wp-content/themes/child-theme/.

I would copy:

/wp-content/plugins/buddypress-followers/_inc/templates/buddypress/

to:

/wp-content/themes/child-theme/buddypress/

Next, open the following template file in your favorite editor or IDE:

/wp-content/themes/child-theme/buddypress/members/single/follow.php

And make whatever changes you need to make.

Please keep in mind that you should not change the ID or CSS classes in the #members-dir-list DIV for AJAX purposes.

v1.1 and lower

v1.2 changed the templating system so you no longer have to add full templates to your theme.

For example, the old templates used to use get_header() and get_footer():

https://github.com/r-a-y/buddypress-followers/blob/1.1.x/_inc/templates/members/single/following.php

The new templates are a template part:

https://github.com/r-a-y/buddypress-followers/blob/1.2.x/_inc/templates/buddypress/members/single/follow.php

If you already using custom templates from v1.1 and lower, BP Follow will still respect these templates, but to take advantage of the new AJAX feature in v1.2, you'll need to remove these older templates and use the new method listed above.

To use the new templates, first remove the older templates:

  • /wp-content/themes/YOUR-THEME/members/single/following.php
  • /wp-content/themes/YOUR-THEME/members/single/followers.php

Then, follow the method listed in the "v1.2" section above.