- Mar 22, 2013
- 9,147
- 10,489
I have a page on a website, and I want it to show only for logged in users. If a user is not logged in, they should be redirected to the login page.
And optionally as a bonus, if they do get to the login page through this process, after they login, they should be redirected to the page they initially tried to visit.
Page:
https://mysite.com/super-cool
I tried the google, but not getting much. There are these two threads:
https://stackoverflow.com/questions/61519270/contact-form-7-only-show-for-logged-in-usershttps://stackoverflow.com/questions/35576100/how-to-only-show-logged-in-users-posts-to-user
The first one he never got the answer about where to put the code. The second one is a bit different than what I need.
I'd rather not use a plugin for this, if at all possible.
Can anyone help? @TomTheCat @BlogPro
And optionally as a bonus, if they do get to the login page through this process, after they login, they should be redirected to the page they initially tried to visit.
Page:
https://mysite.com/super-cool
I tried the google, but not getting much. There are these two threads:
https://stackoverflow.com/questions/61519270/contact-form-7-only-show-for-logged-in-usershttps://stackoverflow.com/questions/35576100/how-to-only-show-logged-in-users-posts-to-user
The first one he never got the answer about where to put the code. The second one is a bit different than what I need.
I'd rather not use a plugin for this, if at all possible.
Can anyone help? @TomTheCat @BlogPro
