• Sjalabais everyone!

    I’m looking for a way to show the author username inside the post loop. I have been searhing around and nothing came up…

    What I need is the username. Not the authors full name. In my blog I get the full name when typing in “the_author()”..

    Thanks for any help. 🙂

Viewing 5 replies - 1 through 5 (of 5 total)
  • You’ll need access directly to the the database. From a MySQL command prompt, run the following query:

    select post_author from wp_posts where post_title="<Post Name>";

    Take this value and enter it into the following query:

    select user_login from wp_users where id='<value>';

    You could also use PHPMyAdmin.

    [signature moderated Please read the Forum Rules]

    Hi,

    Read this article to get more help:

    http://codex.wordpress.org/Author_Templates#Custom_Author_Information

    Thanks,

    Shane G.

    @atle grimseid

    Paste this within the loop:

    <?php the_author_meta( 'user_nicename' ); ?>

    Or:

    <?php the_author_meta( 'user_login' ); ?>

    @jdavis74

    Huh? Did you even read what was asked?

    Sorry, I just noticed you are on an old version of WordPress (you should upgrade to 2.8).

    Read what Shane G posted for older versions.

    Thread Starter atle-grimseid

    (@atle-grimseid)

    Thanks 🙂

    Jup, I’m using 2.7.1. It’s actually WPMU I’m running, witch is currently versjon 2.7.1. The reason I’m asking here in these forums is because what I need is related to one of the sub-blogs, witch would be the same as normal WordPress in my situation.

    greenshady, thanks. At least this is a good solution when I need help with this in 2.8. I’m sure it will be useful for me soon. 🙂

    I was looking at the solution Shane G came up with, but I’m just not quite sure if this is what I’m looking for? As far as I can see this is something I should use outeside the loop, and not inside? I will read over it again and see if there is anything I can use in there. 🙂

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How can I get the author username?’ is closed to new replies.