the_author(0) is echoing the value to the site (3 posts)

  1. craveytrain
    Posted 10 years ago #

    I am setting up a blog for multiple people so I wanted the author name to display. In order to add some zest to it, I'm using sIFR to replace the first letter of the author name. That means I have to parse out the first letter, put that in a span by itself and then the rest of the name after that. After doing some digging in the codex, I constructed:

    $authName = the_author(0);
    $authFL = $authName{0};
    $authLeftovers = substr($authName, 1);

    While it does set the variables correctly, it still echos the value of the_author to the page. This is contrary to what the codex says about giving the boolean a false value. Am I doing something wrong or is this a bug?

    I realize I can use get_userdata() to get the info I am looking for, but I thought that maybe this was a bug so I thought I would bounce it off y'all.

  2. Alex Mills (Viper007Bond)
    Posted 10 years ago #

    Go read the parameters of the function in the Codex.

    Setting 0 as the first parameter doesn't make it return the value, the 2nd parameter does.

  3. craveytrain
    Posted 10 years ago #

    aaahh... I must have missed that last night. Thank you very much.

Topic Closed

This topic has been closed to new replies.

About this Topic