Solved

Wordpress: adjust  get_the_author() function?

Posted on 2013-06-22
3
486 Views
Last Modified: 2013-06-22
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
Comment
Question by:St_Aug_Beach_Bum
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 70

Accepted Solution

by:
Jason C. Levine earned 500 total points
ID: 39268561
0
 

Author Closing Comment

by:St_Aug_Beach_Bum
ID: 39268623
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
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 39268711
Heh, no worries.  

Try "Wordpress guest authors" as your terms...
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question