0

I had set a permission in wordpress anyone can register & can post. If user do post then i need to review it and set to user role (like subscriber to author) and also need to show, on my blog page who is author and who is subscriber but there are shows only user name. please tell me what i code write in author.php to show name with user role

like Jhon Subscriber, Grace Author

See screenshot here

Yajuvendra
  • 13
  • 11
  • What have you tried so far? I've found plenty of information by Googling your exact question: [wordpress show user role](https://www.google.com.au/search?q=wordpress+show+user+role&oq=wordpress+show+user+role&gs_l=serp.3..0i71l8.38306.38607.0.38746.4.4.0.0.0.0.0.0..0.0....0...1c.1.64.serp..4.0.0.Rm_T-KXaE3o). Did none of them work? If not, please post the code that you've used so that we can help you out. – Christian Jul 05 '15 at 11:07
  • Please see screen shot that i attached i dont know how to ask my question – Yajuvendra Jul 05 '15 at 11:12
  • @user3669709 you should make an attempt to code it yourself first and show us some code. – Claudiu Creanga Jul 05 '15 at 11:31
  • @user3669709 Your screenshot doesn't explain what you've tried. It only explains what you want the end result to be. We're here to help you solve problems that you've tried to solve yourself. We aren't here to write code for you for free. If you don't want to attempt to solve the problem yourself and you just want someone to write a solution for you, Stack Overflow isn't for you. – Christian Jul 06 '15 at 02:02

1 Answers1

0

Try this..

<?php //get the commented user id
$user_id   = get_comment(get_comment_ID())->user_id;

if ($user_id)
{
    $user_info = get_userdata($user_id );
    echo implode(', ', $user_info->roles) ;
} ?>
Display Name
  • 105
  • 1
  • 9