Basically you are asking a function to check the post author role. You can use user_can()
function.
if(user_can('administrator'))
{
//Write your code if the admin
}
current_user_can()
: https://codex.wordpress.org/Function_Reference/current_user_can
user_can()
: https://codex.wordpress.org/Function_Reference/user_can