Forked from andrewlimaza/load-custom-css-level-pmpro.php
Last active
February 1, 2022 14:23
-
-
Save travislima/4d09d674dba6a7dc8838cfc26446086c to your computer and use it in GitHub Desktop.
Load custom CSS for Membership Checkout for specific level - Paid Memberships Pro
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Load custom CSS on checkoutpage for specific membership level in Paid Memberships Pro. | |
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function load_css_for_level_checkout(){ | |
global $pmpro_pages; | |
// Change your membership level ID here. | |
if ( is_page( $pmpro_pages['checkout'] ) && isset( $_REQUEST['level'] ) == '1' ) { | |
?> | |
/* Add Custom CSS below */ | |
<style type="text/css"> | |
#other_discount_code_p {display: none;} | |
#other_discount_code_tr {display: table-row !important;} | |
</style> | |
<?php | |
} | |
} | |
add_action( 'wp_footer', 'load_css_for_level_checkout', 10 ); |
The comment:
/* Add Custom CSS below */
should be before the ?> tag.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This recipe is included in the blog post on "How to enhance the appearance of your Membership Checkout page by level using CSS." at Paid Memberships Pro here: https://www.paidmembershipspro.com/how-to-enhance-the-appearance-of-your-membership-checkout-page-by-level-using-css/