Skip to content

Instantly share code, notes, and snippets.

@andrewlimaza
Last active July 22, 2024 10:21
Show Gist options
  • Save andrewlimaza/a29f28d2a4df9937d966801679d3b021 to your computer and use it in GitHub Desktop.
Save andrewlimaza/a29f28d2a4df9937d966801679d3b021 to your computer and use it in GitHub Desktop.
Move Password div below email div jQuery
<?php
/**
* Small jQuery snippet to move password field below email field for Paid Memberships Pro.
* Please note this will affect all instances such as Signup Shortcode, checkout page.
* To only load this on a specific page, please use the 'is_page' WordPress function in a condition.
*/
function my_move_password_below_bemail() {
?>
<script>
jQuery(document).ready(function(){
jQuery( '.pmpro_checkout-field-password' ).insertAfter( '.pmpro_checkout-field-bemail' );
});
</script>
<?php
}
add_action( 'wp_footer', 'my_move_password_below_bemail' );
@manousky
Copy link

Hi Andrew, thanks for this. I tried and tried this snippet several times in Code Snippets, but no changes are discernible on the front end.

Could you please take a look and confirm it's good to go?

Here's my checkout as it stands https://frenchtasticpeople.com/membership-account/membership-checkout/?level=1

I did remove the username field (display:none) after I changed it to bemail.

I also used a piece of code supplied by Kim I believe to remove the confirm email and confirm pwd.

Maybe it has to do with these changes, but the code above doesn't do for some far. Can you please assist me with it?

TIA!
Herman

@andrewlimaza
Copy link
Author

Hey Herman! (@manousky)

Sorry I don't get notifications for comments on my gists. This would need to be tweaked now with V3.1 and the updated code can be seen here -> https://gist.github.com/JarrydLong/f4e93337042046c2edec7f2d67deda32

If you ever need support with an official gist, please do not hesitate to reach out to our support on www.paidmembershipspro.com/support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment