first and lastname
-
Hi there,
I have 3 fields in my mailchimp signup. I’ve seen the post and support on how to add a name field, but how could I add 2 extra fields – first and last name? There’s certainly plenty of room on the topbar! The mailchimp tags are FNAME and LNAMEI have tried placing this in my functions file (child theme) but it’s only showing surname.
add_action( ‘mctb_before_surname_field’, function() {
echo ‘<input type=”text” name=”FNAME” placeholder=”First name” />’;
});add_action( ‘mctb_before_email_field’, function() {
echo ‘<input type=”text” name=”LNAME” placeholder=”Surname” />’;
});
add_filter( ‘mctb_merge_vars’, function( $vars ) {
$vars[‘NAME’] = ( isset( $_POST[‘ FNAME’] ) ) ? sanitize_text_field( $_POST[‘FIRST NAME’] ) : ”;
return $vars;
});
add_filter( ‘mctb_merge_vars’, function( $vars ) {
$vars[‘NAME’] = ( isset( $_POST[‘LNAME’] ) ) ? sanitize_text_field( $_POST[‘SURNAME’] ) : ”;
return $vars;
});Your help would be really appreciated. Thanks in advance.
- The topic ‘first and lastname’ is closed to new replies.