Show user levels in comments loop (2 posts)

  1. tgiokdi
    Posted 6 years ago #

    How do I go about showing either a custom image or just text that says what the commenter's user level is in the comment loop? I've found a few plugins that will highlight comments if they're from the admin, but all the ones that I can see are based off of manual inputs.

    I'd like to have an image or text next to the comment that indicates if the user is a subscriber or a contributor or an admin.

    Any ideas?


  2. s_ha_dum
    Posted 6 years ago #

    Inside the loop:

    <?php print_r(get_userdata($post->post_author)->wp_capabilities); ?>

    You should be able to build an if conditional around that information.

Topic Closed

This topic has been closed to new replies.

About this Topic