I made a little change in the previous code .Please use this code in wplms-customizer.php
function custom_background_image(){
$user = wp_get_current_user();
if ( in_array( ‘instructor’, (array) $user->roles ) ) {
//The user has the “Instructor” role
?>
<style>
#vibebp_member .profile_grid {
background-image:url(URL of background image for
teacher);
background-size: cover;
background-repeat:no-repeat;
}
</style>
<?php
}
elseif (in_array( ‘student’, (array) $user->roles ))
{ //the user has the “student” role
?>
<style>
#vibebp_member .profile_grid {
background-image:url(URL of background image for student);
background-size: cover;
background-repeat:no-repeat;
}
</style>
<?php
}
}
add_action(‘wp_head’, ‘custom_background_image’);
https://prntscr.com/vxahzw