Home / Archive / MemberPress: Set Custom Product Pages
Duplicate Snippet

Embed Snippet on Your Site

MemberPress: Set Custom Product Pages

Use this snippet if the membership shortcode is used on a custom page (the page that is not the default registration page). If Global Styles option is NOT enabled, and the registration form still isn’t working properly, replace 1, 2, 3 with the list of post ID’s for the pages.

Code Preview
php
<?php
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;
} 
add_filter( 'mepr-is-product-page', 'mepr_is_product_page', 10, 2 );

Comments

Add a Comment