how can i show user's role in comment form near their name?!! for example when admin reply a comment i want to show "admin" word near admin name or when a user buy a product from my site and send a comment i want to show "buyer" role in near name
This will print
global $current_user; $user_role = $current_user->roles; echo $user_role;
Use above code, where ever you want to display user role.