This topic has 12 replies, 3 voices, and was last updated 7 years by Radu.

  • Author
  • #154152
     kvento
    Participant

    I’m trying to lock down listings pages (they are being populated from geodirectories) based on membership level. I put the proper shortcode in the listings widget along with the functions.php code and nothing is working. There is no actual “page” to click the membership level access, the content is all being pulled from CPTs.

    want to lock these pages to membership levels:
    http://showoffmydog.com/breeders/
    http://showoffmydog.com/stud_dogs/

    THANK YOU!

    #154234
     Laura
    Moderator

    Hello, will assign the ticket to a higher support level who can help and advise you in your query.
    Thanks! ?

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #154364
     Radu
    Moderator

    Hi,

    You can restrict portions of content using shortcodes see on the next page at the bottom : https://archived.seventhqueen.com/kleo/article/restrict-content-for-certain-membership-level

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #154365
     kvento
    Participant

    Right – it’s not working… I put in the do shortcodes in functions too.

    #154394
     Radu
    Moderator

    Hi,

    Please confirm to me if you area able to restrict a certain page but not a page that belongs to Geo Directory.

    Let me know and provide also an admin account to take a closer look but check that first

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #154397
     kvento
    Participant
    This reply has been set as private.
    #154505
     Radu
    Moderator

    Hi,

    I’ve saw that, there it’s no quick solution for what you need but I’ve created a small function that allows you to restrict by certain post type

    COPY CODE
    
    function my_resitrct_my_cpt() {
        global $pmpro_pages, $post;
    
        if( is_singular( 'gd_breeders' ) || is_singular( 'your_second_cpt' ) ) {
            if ( is_user_logged_in() && !pmpro_hasMembershipLevel() ) {
                if (isset($post->ID) && !in_array($post->ID, $pmpro_pages)) {
                    wp_redirect( pmpro_url() );
                }
            }
        }
    
    }
    
    add_action('template_redirect', 'my_resitrct_my_cpt');
    

    This it’s something custom if you need more assistance for your project I recommend you to hire a developer

    The function needs to be pasted in wp-content/themes/kleo-child/functions.php

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #154506
     Radu
    Moderator

    Hi,

    I’ve saw that, there it’s no quick solution for what you need but I’ve created a small function that allows you to restrict by certain post type

    COPY CODE
    
    function my_resitrct_my_cpt() {
        global $pmpro_pages, $post;
    
        if( is_singular( 'gd_breeders' ) || is_singular( 'your_second_cpt' ) ) {
            if ( is_user_logged_in() && !pmpro_hasMembershipLevel() ) {
                if (isset($post->ID) && !in_array($post->ID, $pmpro_pages)) {
                    wp_redirect( pmpro_url() );
                }
            }
        }
    
    }
    
    add_action('template_redirect', 'my_resitrct_my_cpt');
    

    This it’s something custom if you need more assistance for your project I recommend you to hire a developer

    The function needs to be pasted in wp-content/themes/kleo-child/functions.php

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #154646
     kvento
    Participant

    Thank you, I’ve added it to the child’s function.php but it is not restricting those CPT pages. What am I doing wrong? Do I need to change anything besides ‘your_second_cpt’

    Thank you!

    #154647
     kvento
    Participant

    I just tried to lockdown http://showoffmydog.com/register/ page (regular page) and it’s not working either. I was able to lockdown memberships the other day, but now I can’t do this regular page with the normal page check.

    #154679
     Radu
    Moderator

    Hi again

    I see it seems you need continue custom support and we cannot offer that… we can support oly theme problems and questions you have here custom development needs and i recommend you to hire a developer to implement and to adapt the restrictions as you need.
    I’ve tried to provide you some functions to acheive that but it seems that not are sufficient.

    Have a nice week-end

    https://wpgeodirectory.com/support/topic/add-listing-page-restriction/
    https://wpgeodirectory.com/support/topic/paid-membership-pro-page-restriction/

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #154688
     kvento
    Participant

    I should be able to lock down a regular page like /register should I not? Please advise.

    #154897
     Radu
    Moderator

    A regular page yes but the register page it’s part of buddypress used for user registering and if you will restrict that a guest user cannot reach that page and it cannot create account.

    And if the page it’s assigned as register page in buddypress settings, it’s possible to not works but for the rest of the pages yes.

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 13 posts - 1 through 13 (of 13 total)

The forum ‘Plugins questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?