Page visibility private displays 404 error
-
When a user who is not logged in navigates to a page that is marked private they receive a 404 error page. I’d like the page to display a kind reminder to please login to view this page.
I tried adding the following to the page loop, but a non logged in user still gets the 404 error page.
if ($post->post_status == "private" && !is_user_logged_in()) { echo "You must be logged in to view this page."; } else if( $post->post_status == "private" && is_user_logged_in() ) { // Page code goes here }
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Page visibility private displays 404 error’ is closed to new replies.