Forums

Returning the Author name (5 posts)

  1. 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?

  2. zoonini
    help me help you
    Posted 11 months ago #

    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?

  3. 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.

  4. zoonini
    help me help you
    Posted 11 months ago #

    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.

  5. keesiemeijer
    moderator
    Posted 11 months ago #

Reply

You must log in to post.

About this Topic