This topic has 2 replies, 2 voices, and was last updated 6 years by Radu.

  • Author
  • #198822
     antonis123
    Participant

    Hi there.

     

    When someone (who has not registered yet therefore not logged in) makes a search of profiles, is there a way that we can limit the information shown per profile? We only want to show them the full profile details once they have opened up an account and have signed in.

     

    Thanks.

    Antonis

    #198828
     antonis123
    Participant

    Basically what I want to do is to restrict non-registered members to only have access up to the profile search results (https://seventhqueen.com/demo/sweetdatewp/members/?field_3=Man&field_6=Woman&field_2=18&field_2_to=75&field_17=&bs=+) and once they want to connect with someone, they would then go to our PMP plans.

    #198892
     Radu
    Moderator

    Hi,

    You can do that using this snippet

    COPY CODE
    
    function sqr_prevent_profile_guest_user() {
        if ( class_exists( 'BuddyPress' ) ) {
            if (!is_user_logged_in() && bp_is_user()) {
                wp_redirect(home_url() . '/membership-levels/');
                exit;
            }
        }
    }
    add_action('template_redirect', 'sqr_prevent_profile_guest_user');
    

    The snippet will be added to wp-content/themes/sweetdate-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
Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

Log in with your credentials

Forgot your details?