/*Reverse sticky header*/

Auto Follow One User

Please be advised that there’s currently no out-of-the-box option to do this in BuddyBoss. Modifications are typically considered custom work, but we are making an exception in this case.

Kindly try using the following code to set a dynamic user ID. You need to change the user ID from 80 to your desired value.

$user_id: This is the ID of the newly registered user.

$jlearn = 80;: This sets the user ID of the account that new members should automatically follow.

bp_start_following: This is a function that initiates the following relationship between the new user and the specified user.

1. Go to Appearance > Theme File Editor

2. Under “Select theme to edit”, choose (BuddyBoss Child/Whatever theme is active), then click “Select”.

3. Below Theme Files, select Theme Functions (functions.php).

4. Append the following just before the closing PHP tag “?>”:

/* Auto follow JLearn */ function lauralisa_followjlearn( $user_id ) { if( !$user_id ) return false; $jlearn = 80; // This is the user ID of the client account bp_start_following( array( 'leader_id' => $jlearn, 'follower_id' => $user_id ) ); } add_action( 'bp_core_activated_user', 'lauralisa_followjlearn' );

NOTE: Please make a backup of your site.

5. Click “Update File”.

Note: Any modifications are considered as custom work already. Know more about our Support Policy here: https://www.buddyboss.com/support-policy/

Was this article helpful?

Related Articles

Subscribe to Our Newsletter

Stay In Touch

Subscribe to our Newsletter, and we’ll send you the latest news from BuddyBoss

  • This field is hidden when viewing the form
  • This field is for validation purposes and should be left unchanged.

To speak to our Agency consultant, fill in the form found at our Contact Page.

"*" indicates required fields

Get Started

Enter your name and email address to get started with your project...

Name*
Profile photo of
Not recently active