WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Display a specific field gathered by Register Plus (8 posts)

  1. chriscolhoun
    Member
    Posted 5 years ago #

    Hi Guys,

    Thanks in advance to anyone who reads my post.

    I have been looking around and cannot find a solution this is probably very easy to solve!

    I simple want to echo the value of a custom field taken by Register Plus and display it within a post of the post Author.

    So the custom field was "Address" and another could be "Postcode" and I simply want to echo the address and postcode at the end of the post!

    Thanks in advance

    C

  2. chriscolhoun
    Member
    Posted 5 years ago #

    Where is the Register Plus additional information stored? :o

  3. MichaelH
    Member
    Posted 5 years ago #

  4. chriscolhoun
    Member
    Posted 5 years ago #

    Hi MichaelH, Many thanks for your quick response. Unfortuantly everything in that thread is much to complicated for what I want to achieve. I simply need to call one or two custom fields.

    I have been using:

    $userdata->address

    Based on code within (http://wordpress.org/support/topic/196934?replies=8) this thread. Unfortunately unsuccessful so far, thanks tho.

  5. MichaelH
    Member
    Posted 5 years ago #

    You mean something like this in a post loop?

    <?php
    $user = get_userdata($post->post_author);
    //echo "<pre>"; print_r($user); echo "</pre>";
    echo = $user->postcode;
    ?>

    Delete the // on that one line to see ALL the user data.

  6. chriscolhoun
    Member
    Posted 5 years ago #

    Hmmm, That seems to break my page! I defiantly the field postcode also tried default fields like user_email.

  7. MichaelH
    Member
    Posted 5 years ago #

    Oops,

    <?php
    $user = get_userdata($post->post_author);
    //echo "<pre>"; print_r($user); echo "</pre>";
    echo  $user->postcode;
    ?>
  8. chriscolhoun
    Member
    Posted 5 years ago #

    Works perfectly. Will mark this as resolved. Many Thanks Michael :) Appreciate it.

Topic Closed

This topic has been closed to new replies.

About this Topic