• Resolved jen3126

    (@jen3126)


    Hello! I have tried several ways to add the Mailchimp Top Bar add first name code and nothing changes the top bar. It still only asks for the email address. I used this code from the Mailchimp website and changed NAME to FNAME. I tried adding directly to PHP files, using a theme editor, and a PHP editor widget and nothing made the top bar look different. I am using a parent theme if that matters. Would love help! Thanks!

    • This topic was modified 4 years, 5 months ago by jen3126.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Harish Chouhan

    (@hchouhan)

    Hello,

    Can you please share the exact code you used? Also, where did you add the code?

    Hi, I have an other issue.
    I addedd the code via snippet
    add_action( ‘mctb_before_submit_button’, function() {
    echo ‘<input type=”text” name=”FNAME” placeholder=”Your name” />’;
    });

    add_filter( ‘mctb_data’, function( $vars ) {
    $vars[‘FNAME’] = ( isset( $_POST[‘FNAME’] ) ) ? sanitize_text_field( $_POST[‘FNAME’] ) : ”;
    return $vars;
    });

    changed NAME to FNAME to match my MERGE data in the mailing list, but the NAME data is not collected in the audience.

    Plugin Contributor Lap

    (@lapzor)

    Where / how did you add this code to your site? I don’t see the first name field added to your topbar as if that code is not being executed.

    I used a snippet to add the bar to any page.
    The code works, the NAME filed exist but is not registered by mailchimp in audience list
    https://www.mercatodeivignaioli.it

    • This reply was modified 4 years, 1 month ago by pievedepitti.
    Plugin Contributor Harish Chouhan

    (@hchouhan)

    Hey @pievedepitti,

    Can you please go to the “MC4WP > Others” menu and share with us the errors listed there?

    Hi, now it works. Don’t know if it was a matter of linking mailchimp and the audience list again. I disconnected and reconnected the list and now works.
    Thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Mailchimp Top Bar Add Name Code Issue’ is closed to new replies.