Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Wordpress: adjust  get_the_author() function?

Posted on 2013-06-22
3
Medium Priority
?
493 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 2000 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

Plesk WordPress Toolkit

Plesk's WordPress Toolkit allows server administrators, resellers and customers to manage their WordPress instances, enabling a variety of development workflows for WordPress admins of all skill levels, from beginners to pros.

See why 2/3 of Plesk servers use it.

Question has a verified solution.

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

In order to have all security and back ups taken care of, WordPress users can sign up for services with WP Engine.
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 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…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

722 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