MyDaily-Gadget
Member
Posted 11 months ago #
Hi guys,
I want to make an "if" sequence, splitting the condition using authors name. Which function can I use to return the name of an author, or something else to distinguish them?
Searching the codex, I found the get_the_author_meta('user_login'). Will this work?
I've used this to display the author's name within the loop:
<?php the_author(); ?>
ref: http://codex.wordpress.org/Function_Reference/the_author
Would this work for you?
MyDaily-Gadget
Member
Posted 11 months ago #
I don't need to display the author's name, I need to return it to php. Also, I want to use this before the </head> tag, so that means outside the loop.
Ah, thanks for clarifying. Seems like you're on the right track, according to:
NOTE: Use get_the_author_meta() if you need to return (not display) the information.
http://codex.wordpress.org/Function_Reference/the_author_meta
Maybe someone else can chime in to confirm if you haven't already tried it out in your script.