I like to secure a certain page for admins. How do I check if a user is logged (and is admin)? Of their not logged in, I want to show the login module.
2 comments
Comments are closed.
I like to secure a certain page for admins. How do I check if a user is logged (and is admin)? Of their not logged in, I want to show the login module.
Comments are closed.
This will redirect non-admins to login URL. Of course, logged in non-admins will be a bit confused. You’ll want to run this before
get_header()
Alternatively you can set a page as PRIVATE and give a password for it. You get this option when you “Quick Edit” a page.