Jump to content
Sign in to follow this  
gayatriom

Parse error when adding file to functions.php in platformprobase

Recommended Posts

gayatriom

Parse error: syntax error, unexpected '<' in line.... Hey. So i just want to make sure I'm adding the following code in the right place in functions.php . there's a lot of stuff there and i'm not sure where i should add the code. <?php /*custom functions to get next/prev group id*/ //find next group id, return false if current group is last function custom_get_next_group_id(){ //global $group; $current_group_id=bp_get_current_profile_group_id(); //get all the groups $groups = BP_XProfile_Group::get( array( 'fetch_fields' => false ) ); $group_id=false; foreach($groups as $group){ if($group->id>$current_group_id){ $group_id= $group->id;//this is immediate next group break; } } return $group_id; } //find prev group, 0 if this is first group function custom_get_prev_group_id(){ //global $group; $current_group_id=bp_get_current_profile_group_id(); //get all the groups $groups = BP_XProfile_Group::get( array( 'fetch_fields' => false ) ); //sniff prev group_id $group_id=0;//which is non existent foreach($groups as $group){ if($group->id<$current_group_id){ $group_id= $group->id;//immediate next group is continue; } } return $group_id; } //get the edit link for a group function custom_get_group_edit_link($group_id){ global $bp; return $bp->displayed_user->domain . $bp->profile->slug . '/edit/group/' . $group_id; } ?>

Share this post


Link to post
Share on other sites
wendygordon

i get this error every time i try to change the functions.php file directly from the editor in wordpress. when i make the changes directly to the file and reupload it works fine.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×