WordPress.org

Ready to get started?Download WordPress

Forums

Author name in header? (10 posts)

  1. Ryan McCue
    Member
    Posted 7 years ago #

    Is it possible to have a post's author's name in a header file, e.g. on one of my posts, where it says (insert author here) ?
    I have tried searching, but that was inconclusive.

  2. yosemite
    Member
    Posted 7 years ago #

    Your description is a bit confusing,have you looked at this?:
    http://codex.wordpress.org/Template_Tags/the_author

  3. Ryan McCue
    Member
    Posted 7 years ago #

    That must be used inside the loop.
    I am looking for something that will display the author of a post's name, but in the header.
    For example, say I went to a post like
    Title: 5 Days Left
    Author: Ryan McCue
    It shows this in the middle of the page (e.g. in the loop, but I want to get the author's name in the header.
    I hope this clarifies a bit.

  4. Ryan McCue
    Member
    Posted 7 years ago #

    Does anyone have any idea at all?

  5. Ryan McCue
    Member
    Posted 7 years ago #

    Help!!!!

  6. billh
    Member
    Posted 7 years ago #

    Use the_author(). You can use it anywhere on the page; it isn't limited to within the loop.

  7. Ryan McCue
    Member
    Posted 7 years ago #

    It says:

    The author of a post can be displayed by using this Template Tag. This tag must be used within The Loop.

    Any ideas? If I have to, I can hack the files.

  8. Ryan McCue
    Member
    Posted 7 years ago #

    Any ideas at all other than the_author() ?
    Or is the Codex wrong?

  9. Ryan McCue
    Member
    Posted 7 years ago #

    Actually, is there a way to hack into the loop and get the_author()?
    *cough* Bump *cough*

  10. incertus
    Member
    Posted 7 years ago #

    Another approach would be to just call the_author in the loop but enclose it in a div that you style with position: absolute and something like left: 700px; top: 200px; to locate it in your header (you would have to play with the numbers to get it right). And of course if you have a fluid width design it could get ugly. And the there is IE. But if you give the div some height value it should work.

Topic Closed

This topic has been closed to new replies.

About this Topic