Solved

Wordpress: adjust  get_the_author() function?

Posted on 2013-06-22
3
464 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
phpmyadmin 3 33
<? versus <?php 5 37
is this a cms? 8 35
Need assistance with TXT file export.  While Loop has issue. 1 17
So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The purpose of this video is to demonstrate how to update a WordPress Site’s version. WordPress releases new versions of its software frequently and it is important to update frequently in order to keep your site secure, and to get new WordPress…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

867 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now