• Resolved nimblesage

    (@nimblesage)


    The code below displays the logged in user’s first and last names even when used in a post loop:
    [user field=first_name] [user field=last_name]

    [loop type=post]
    [field title]
    [field excerpt]
    [user field=first_name] [user field=last_name]
    [/loop]

    This `[field author]’ displays the username of the author, but not the first and last names like I need.

    Suggestions, please.

    Thank you!

Viewing 5 replies - 1 through 5 (of 5 total)
  • I think you need to pass the author ID to an users loop.

    Thread Starter nimblesage

    (@nimblesage)

    Thanks for your response, Peter.
    I tried the code below and got the same results…the first and last name of the logged in user.

    [loop type=post]
    [field title]
    [field excerpt]
    [pass field=author][user field=first_name] [user field=last_name][/pass]
    [/loop]

    I may be using the wrong syntax.

    You are not passing the author ID to an user loop. Take a look at the plugin reference for User and Pass.

    Try this code:

    [pass field=author-id]
    [users include={FIELD}]
    ID: {FIELD}
    First name: [user first_name] 
    Last name: [user last_name] 
    Contact: [user email]
    [/users]
    [/pass]

    Peter

    Thread Starter nimblesage

    (@nimblesage)

    This worked like a charm, Peter. Thank you!

    You’re welcome. Don’t forget to mark this as resolved.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Display author first name and author last name’ is closed to new replies.