Rearranging fields in my MemberPress form also duplicates them

I want to modify my MemberPress registration form field order. I want email to be at the top rather than down below the username field where it sits by default. I'm using this code in my child theme's functions.php file. It works, but it also duplicates the field on the form - now there are two email fields at the top - and I can't figure out how to fix it: function mepr_reorder_fields() { ?> <script> (function($) { $(document).ready(function() { var email = $('.mepr_email'); var firstname= $('.mepr_first_name'); if(email.length) { email.insertBefore(firstname); } }); })(jQuery); </script> <?php } add_action( 'wp_head', 'mepr_reorder_fields' ); Here's my form with two email fields at the top:

Comment (0)

You’ll be in good company