Title: Add fields
Last modified: September 23, 2016

---

# Add fields

 *  [RenaiSens](https://wordpress.org/support/users/renaisens/)
 * (@renaisens)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/add-fields-2/)
 * Hi,
 * Into the registrer form, I want to add fields (lirtsname, lastname, town, country).
   
   How can I do that ?
 * Thanks
    Ludovic

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Jeff Farthing](https://wordpress.org/support/users/jfarthing84/)
 * (@jfarthing84)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/add-fields-2/#post-8218964)
 * [https://www.jfarthing.com/development/theme-my-login/adding-extra-registration-fields/](https://www.jfarthing.com/development/theme-my-login/adding-extra-registration-fields/)
 *  Thread Starter [RenaiSens](https://wordpress.org/support/users/renaisens/)
 * (@renaisens)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/add-fields-2/#post-8227379)
 * Thanks Jeff,
 * It doesn’t run.
    When I go to the register page, I don’t see the added fields
   [http://flammesjumelles.world/register/](http://flammesjumelles.world/register/)
 * 1 –
    I add this code into the register-form.php file (between <form> and </form
   >) that is into the root of my child theme (into the main theme it’s the same–
   it doesn’t run).
 * ———- code ———-
    <p> <label for=”first_name<?php $template->the_instance(); ?>”
   ><?php _e( ‘First name’, ‘theme-my-login’ ) ?></label> <input type=”text” name
   =”first_name” id=”first_name<?php $template->the_instance(); ?>” class=”input”
   value=”<?php $template->the_posted_value( ‘first_name’ ); ?>” size=”20″ tabindex
   =”20″ /> </p> <p> <label for=”last_name<?php $template->the_instance(); ?>”><?
   php _e( ‘Last name’, ‘theme-my-login’ ) ?></label> <input type=”text” name=”last_name”
   id=”last_name<?php $template->the_instance(); ?>” class=”input” value=”<?php 
   $template->the_posted_value( ‘last_name’ ); ?>” size=”20″ tabindex=”20″ /> </
   p>
 * 2 – And I have theme-my-login-custom.php file into the root of plugins folder
   with this single code :
    ——– code ——— <?php
 * function tml_registration_errors( $errors ) {
    if ( empty( $_POST[‘first_name’]))
   $errors->add( ’empty_first_name’, ‘**ERROR**: Please enter your first name.’ );
   if ( empty( $_POST[‘last_name’] ) ) $errors->add( ’empty_last_name’, ‘**ERROR**:
   Please enter your last name.’ ); return $errors; } add_filter( ‘registration_errors’,‘
   tml_registration_errors’ );
 * function tml_user_register( $user_id ) {
    if ( !empty( $_POST[‘first_name’] ))
   update_user_meta( $user_id, ‘first_name’, $_POST[‘first_name’] ); if ( !empty(
   $_POST[‘last_name’] ) ) update_user_meta( $user_id, ‘last_name’, $_POST[‘last_name’]);}
   add_action( ‘user_register’, ‘tml_user_register’ ); ?>
 * ———- Info ———
    I use multisite and WP 4.6
 * Thanks for your help.
    Ludovic
 *  Plugin Author [Jeff Farthing](https://wordpress.org/support/users/jfarthing84/)
 * (@jfarthing84)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/add-fields-2/#post-8244032)
 * The code/process would actually be a little different for multisite. Unfortunately,
   I haven’t yet documented doing so.
 *  [mkaiit](https://wordpress.org/support/users/mkaiit/)
 * (@mkaiit)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/add-fields-2/#post-8254405)
 * Hi
    please if i want to do the same add feilds, i have to know php? i tried searching
   if there is something ready i cant find please can u suggest?

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Add fields’ is closed to new replies.

 * ![](https://ps.w.org/theme-my-login/assets/icon-256x256.png?rev=1891232)
 * [Theme My Login](https://wordpress.org/plugins/theme-my-login/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/theme-my-login/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/theme-my-login/)
 * [Active Topics](https://wordpress.org/support/plugin/theme-my-login/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/theme-my-login/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/theme-my-login/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [mkaiit](https://wordpress.org/support/users/mkaiit/)
 * Last activity: [9 years, 8 months ago](https://wordpress.org/support/topic/add-fields-2/#post-8254405)
 * Status: not resolved