0

before I ask this question I would just like to say a big thank to those who helped with my other question.

On some wordpress blogs I've seen, with multiple post authors. When you view the full post on the single page, in the meta the author name is a different colour to the admin.

For example if the a post was posted by the Admin then it's colour would be pink. But if the post was posted by another author, the colour of the name would be yellow.

I know some questions ask about different colour posts or comments, but I'm asking about the post author name.

2

You can check if post's author has Administrator role like this (and output markup accordingly):

if( author_can( get_the_ID(), 'administrator' ) ) {

    // author is admin
}
else {

    // author is not admin
}

See Roles and Capabilities if you want to check for something more specific than general role.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy