WordPress Custom Field Trick #3: Conditionally Display Guest Authors' Names
If you have a blog where you invite guest authors to write for you and don't want to create accounts for them, you can create a custom field for the guest authors' name and display it in a case where this field has a value. Create a new custom field with the key Guest-Author
. Enter your guest author's name as the value for it.
Now open the file functions.php and enter the following code to create a new function.
Now check out the output in your Web browser. The author name should contain the value you entered in the value for the key Guest-Author
.