Custom filters: Single post show author meta for Authors

// Add this in you single post template
// See https://developer.wordpress.org/themes/basics/template-hierarchy/

// First we get the author role:
global $authordata; // The author object for the current post. See https://codex.wordpress.org/Global_Variables
$author_roles = $authordata->roles; // Get all author roles. See https://codex.wordpress.org/Class_Reference/WP_User
$author_role = array_shift( $author_roles ); // Get the user role

// Now we check if the author is an editor
if ( $author_role != ‘editor’ ) {
// Show the author box
}

Scroll to Top