- This topic has 3 replies, 2 voices, and was last updated 9 years, 8 months ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- The topic ‘Log in to view instead of 404?’ is closed to new replies.
Is there a way that a non-logged in user would see a page asking them to log in if they tried to follow a link to a post that they did not have permission to see (rather than a standard 404 page)? Thanks!
Hi Ahmed,
There are no filters or actions to hook into a 404 when the user doesn’t have permission. If you are familiar with editing PHP files and WordPress functions, you can create a custom 404 page with the content short-codes functionality and the following tutorial.
https://codex.wordpress.org/Creating_an_Error_404_Page
Even if you do this, every 404 will display the login page, not just the pages where they don’t have permission. I’ll add this to my to do list, but I’m not guaranteeing it at this moment.
Thanks
Syam
You could just use the content shortcodes to hide the content and display a login form, without using extended permissions.
Thanks, this will give me something to work with.