MemberPress: Set Custom Product Pages

function mepr_is_product_page( $return, $post ) { $custom_pages = array( 1, 2, 3 ); //Replace these numbers with the post ID’s of the pages if( isset( $post ) && in_array( $post->ID, $custom_pages ) ) { return true; } return $return; }…Continue reading

MemberPress: Disable Address Fields for a Specific Membership

function mepr_disable_address_fields( $fields ) { if ( is_single( array( 12, 564 ) ) ) { $hide_fields = array( ‘mepr-address-state’, ‘mepr-address-zip’, ‘mepr-address-one’, ‘mepr-address-two’, ‘mepr-address-city’, ‘mepr-address-country’, ); foreach ( $fields as $key => $field ) { if ( isset( $field->field_key ) &&…Continue reading

MemberPress: Pass a Member Phone Number to Stripe

function mepr_pass_phone_number_to_stripe( $args, $user ) { $phone = get_user_meta( $user->ID, ‘mepr_phone’, true ); if ( ! empty( $phone ) ) { $args[‘phone’] = $phone; } return $args; } add_filter( ‘mepr_stripe_create_customer_args’, ‘mepr_pass_phone_number_to_stripe’, 10, 2 );Continue reading

Change default zoom for all PDF files in PDF Embedder Premium

/** * Set the default zoom value for all shortcodes/blocks regardless of their settings. * See https://wp-pdf.com/premium-instructions/shortcodes/#zoom for available Zoom values. */ add_filter( ‘pdfemb_premium_viewer_strings’, static function( $atts ) { $atts[‘zoom’] = ‘page-actual’; $atts[‘fpzoom’] = ‘page-actual’; return $atts; } );Continue reading

Floating Social Media Icons (copy)

// Define social media links $facebook_link = ‘https://facebook.com/fb’; $twitter_link = ‘https://youtube.com/@yt’; $instagram_link = ‘https://instagram.com/ig’; echo ‘ .floating-social-icons { position: fixed; top: 50%; left: 0; transform: translateY(-50%); z-index: 1000; } .floating-social-icons a { display: block; margin: 5px 0; width: 40px; height:…Continue reading

“New” Badge for Recent Posts (copy)

add_filter( ‘the_title’, function ( $title, $id ) { if ( ! is_admin() && is_single( $id ) ) { $number_of_days = 7; $post_date = get_the_date( ‘U’, $id ); $current_date = current_time( ‘timestamp’ ); $date_diff = $current_date – $post_date; if ( $date_diff…Continue reading

“New” Badge for Recent Posts

add_filter( ‘the_title’, function ( $title, $id ) { if ( ! is_admin() && is_single( $id ) ) { $number_of_days = 7; $post_date = get_the_date( ‘U’, $id ); $current_date = current_time( ‘timestamp’ ); $date_diff = $current_date – $post_date; if ( $date_diff…Continue reading

Floating Social Media Icons

// Define social media links $facebook_link = ‘https://facebook.com/yourprofile’; $twitter_link = ‘https://twitter.com/yourprofile’; $instagram_link = ‘https://instagram.com/yourprofile’; $linkedin_link = ‘https://linkedin.com/in/yourprofile’; echo ‘ ‘;Continue reading