Have you ever had a guest blogger contribute to your site? What is the best way to give the author full credit? We’ve encountered a lot of sites that include an author profile box either above or below the post. However, even if the guest author box was checked, the site author’s name would still appear in the author name field. In order to reflect the correct name, some blogs construct entirely new author profiles for their guest authors. If you know that this guest author will just publish once, we believe it is unnecessary to create additional user profiles.
The approach we’ll teach you in this article will allow you to display the name of a guest author by simply adding a custom field to your post.
Paste the following codes into your functions.php file:
Now, whenever you publish a guest post, simply add a custom field called guest-author, and the author’s name will be replaced with the text you enter in that custom field.