• Resolved gediweb

    (@gediweb)


    I have a directory and was able to password protect all the pages set up except the directory single listing page which is dynamic and uses single() and has a designated url: /listing/*

    Is it possible to also password protect these individual pages? Maybe a function? I tried this code but it’s looking for actual WP logins and redirects if you are not an admin.

    if ( is_single()  &&  ! is_user_logged_in() ){
        wp_redirect( site_url( '/directory_listings/' ) );
        exit();
    }

    Any help would be appreciated.

Viewing 1 replies (of 1 total)
  • Plugin Author patrickposner

    (@patrickposner)

    Hey @gediweb,

    thanks for your message.

    There is conditional function included in Passster: passster\PS_Conditionalis_valid();

    If used without any parameters it checks if a valid cookie is set and unlocks the content. This is not a full solution (templating functions are part of another release) but should give you a basic idea to make that work.

    Best regards,
    Patrick

Viewing 1 replies (of 1 total)
  • The topic ‘password protect a dynamic page?’ is closed to new replies.