Hey there,
So you want to redirect all logged out users to that page?
You don’t want them to be able read the content if logged out?
Not sure that’s a good thing to do, but if that’s what you need then maybe something like:
if ( !is_user_logged_in() ) {
wp_redirect( home_url() . '/wp-login.php');
exit;
}
You could hook that into the page:
http://codex.wordpress.org/Function_Reference/add_action#Simple_Hook
http://codex.wordpress.org/Plugin_API/Action_Reference
You may also find a plugin here that helps:
https://wordpress.org/plugins/tags/redirect
Hopefully that should get you in the right direction. Let me know how you go.
Thread Starter
kgh79
(@kgh79)
Hi
Thanks for that Tim… what I am creating is a website that has around 140 users and then each user will have their own space… so all I need is the home page to be a log in page for that user… a separate issue I have is that I then need other users to have read only access the other spaces… I am a newbie WP so bear with me!
Hey there.
Then rather than redirecting you could just just create a login page for the front of your site:
http://codex.wordpress.org/Function_Reference/wp_login_form
Or use a plugin:
http://wordpress.org/plugins/search.php?q=login+form
WordPress Multisite wouldn’t let people edit other peoples websites. They would need to be an admin first. If you don’t want to give them a whole website in a network install then maybe consider something like BuddyPress:
http://buddypress.org/
Hope this helps.
Take care.
Thread Starter
kgh79
(@kgh79)
Hi Tim
thanks for the advice
when I add plugin… it still shows my header menu and posts etc…
all I want my home page to show is the username and password as per the wp-login..
the if code you sent previously – in which php would I insert it into? Thanks
Hey there,
You would pop that into a hook and then into your functions.php file of the theme or a mini plugin which you’d have to make.
I just took another look and it seems there is a plugin doing this:
https://wordpress.org/plugins/private-only/
Take care.
Thread Starter
kgh79
(@kgh79)
I added into the functions file but didnt seem to work – I must be doing something wrong!!
I also tried this plugin and couldnt make it work either
think I am a lost cause 🙁