password protect a dynamic page?
-
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)
Viewing 1 replies (of 1 total)
- The topic ‘password protect a dynamic page?’ is closed to new replies.