Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
/**
* This recipe will add in the necessary classes to PMPro Buttons, ensuring they
* have the same look & feel as your theme: GeneratePress
*
* https://wordpress.org/themes/generatepress/
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function mypmpro_generatepress_classes( $class, $element ){
if ( in_array( 'pmpro_btn', $class ) ) {
$class = array();
$class[] = 'button';
}
return $class;
}
add_action( 'pmpro_element_class', 'mypmpro_generatepress_classes', 10, 2 );
@laurenhagan0306

This comment has been minimized.

Copy link

@laurenhagan0306 laurenhagan0306 commented Mar 31, 2021

This recipe is included in the blog post on "Using the GeneratePress Theme by Tom with Paid Memberships Pro" at Paid Memberships Pro here: https://www.paidmembershipspro.com/generatepress-theme-by-tom-paid-memberships-pro/

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