Displaying Roles on Front End
-
I am currently using the following piece of code to display a user’s role on the front end, but it seems to only display the “main” role, or the role the user was assigned prior to the plugin installation. Is there a way to alter this to have it display ALL roles assigned to a user, or something that can be done with the plugin to give me the option of which role to display for each user?
<?php the_author_posts_link(); ?> - <?php $aid = get_the_author_meta('ID'); $role = get_user_role( $aid ); $wp_roles = wp_roles(); $pretty_role = $wp_roles->roles[$role]['name']; echo $pretty_role; ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Displaying Roles on Front End’ is closed to new replies.