• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 539
  • Last Modified:

Wordpress: adjust get_the_author() function?

I have guest authors sometimes.

I don't want to set them up as members of my blog. But I would like to display their name as being the author of the post they write.

I enter their name as a custom field (field name "guest_auth") when I save the post.

Then, because I need to set the 'author' setting to something, I set it to "guest".

Would it be possible to have a function in functions.php so that whenever get_the_author()  is called in my theme (post pages, category pages, home page, etc).... IF there is a 'guest_auth' value, it will show that name instead of "guest"?

Or perhaps, if get_the_author() == "guest," it uses the guest_auth value for that post...

I realize I could do this in the code on each page/post, but there are a lot of pages in my theme. Seems it would be more efficient to do this in functions.php if there is a way.

Ideas?

Thanks,

Chris
0
St_Aug_Beach_Bum
Asked:
St_Aug_Beach_Bum
  • 2
1 Solution
 
St_Aug_Beach_BumAuthor Commented:
Oh, well darn, your right :)

When I googled it earlier today, I didn't find squat!

Thank you very much - these will work!

Chris
0
 
Jason C. LevineNo oneCommented:
Heh, no worries.  

Try "Wordpress guest authors" as your terms...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now