WordPress.org

Support

Support » Themes and Templates » Query author name – the Geek-ie way

Query author name – the Geek-ie way

  • Could someone please kindly advise where I should put this beautiful code?

    I tried before the Loop, as such:

    <div id=”maincontainer”>
    [p class=”breadcrumb”> All Titles By:
    <?php
    global $wp_query;
    $author = $wp_query->get_queried_object();
    echo $author->first_name . ' ' . $author->last_name;
    ?>

    [/p]
    </div>

    I couldn’t get it output the author name.

    Have I missed an important piece of code somewhere?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Oops! Forgot you’re one of our 1.5.2 folk still:

    <?php
    global $wp_query;
    $author = $wp_query->get_queried_object();
    echo $author->user_firstname . ' ' . $author->user_lastname;
    ?>

    2.0 really is a different animal…

    Thanks – will try it and report back if a no-goer.

    Eekkk!

    It worked!

    Well, I just knew it.

    You really are brilliant!

    PS: I won’t upgrade until all the bugs are smashed to smithereans – is that a proper word?

    Anyway, I don’t like madness 🙁

    You really are brilliant!

    I had other options at the ready in case I wasn’t. :/

    Note: smithereens. Like the group, you know.

    *laughing hilariously*

    Good grief, I thought I was the only one who knew about them….

    Ok I am really new at this but my posts don’t show the author either and I would want them too. I just installed WP a week ago 1-10-07.

    With this in mind, what is this “loop” everyone is talking about and what file and where do I insert this.. lOL

    Again over my head here LOL

    <?php
    global $wp_query;
    $author = $wp_query->get_queried_object();
    echo $author->user_firstname . ‘ ‘ . $author->user_lastname;
    ?>

    The Loop

    To display author information *in* The Loop, check out the Author template tags:

    http://codex.wordpress.org/Template_Tags#Author_tags

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Query author name – the Geek-ie way’ is closed to new replies.