Forums

[Register plus] Call custom field in theme (9 posts)

  1. my-web
    Member
    Posted 3 years ago #

    Hello Guys.

    I need to call the custom field that i have created with Register Plus in the theme. How i can do it?

    But i need call specific custom field input in automatic from authors info.

    Excuse for my bad english.

  2. MichaelH
    Volunteer
    Posted 3 years ago #

  3. my-web
    Member
    Posted 3 years ago #

    Thanks MichaelH
    My problem is that i must call a input from specific custom field created with Register Plus.

    For example: I have created a custom field with name "adsense" in this field the author must enter your adsense code (in wordpress profile) and i must call the code (with custom field calling) for show the adversing in the post author.

    Can help?

  4. MichaelH
    Volunteer
    Posted 3 years ago #

    My problem is that i must call a input from specific custom field created with Register Plus.

    Where do you wish to 'call a input'? In the admin section or when displaying posts on the blog.

  5. my-web
    Member
    Posted 3 years ago #

    i want display it in the template of my site.

  6. MichaelH
    Volunteer
    Posted 3 years ago #

  7. my-web
    Member
    Posted 3 years ago #

    I can use it

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

    "; print_r($user); echo "
    ";
    echo $user->postcode;
    ?>

    in template file for call the custom field?
    And my custom field name is "adsense" where i must place it?
    Thanks Michael

  8. MichaelH
    Volunteer
    Posted 3 years ago #

    Note that this line

    //echo "<pre>"; print_r($user); echo "</pre>";

    was intended as a commment to enable you to see all the returned values if necessary so normally delete that line in your actual code:

    As for your adsense, that probably is

    echo $user->adsense;
  9. chirho
    Member
    Posted 2 years ago #

    This is probably too late to help anyone, but I just had to figure this out myself, and this worked for me within register-plus.php:

    <?php echo get_usermeta($un->ID, 'badge_number'); ?>

    "badge_number" being my custom field "Badge Number"

Topic Closed

This topic has been closed to new replies.

About this Topic