Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a site here...

If a user clicks on Submit an Event or Send an Article, they are re-directed to a 404 page because I have it set up to make the page private.

What I want to do is if the user is logged in, it goes to the correct page. But if the user isn't logged in, then they get directed to this registration page.

I don't see any way to do this withing the settings of Wordpress.

Thoughts?

share|improve this question
    
your site does not look good on 1024x768 –  user9 Nov 4 '13 at 19:22
    
are you okay with a plugin to wordpress, or do you need php code? –  user9 Nov 4 '13 at 19:23
    
A plugin is fine if it does what I'm looking for. I've tried Redirect to login if not logged in but that redirects to log-in page, from the moment the user steps on the website. I want the user to be able to get to the site, but if they click on a protected link, they get re-directed to the registration/log-in page. –  webfrogs Nov 4 '13 at 19:35
    
And I'm aware of the resolution issues. Working on it. –  webfrogs Nov 4 '13 at 19:35
add comment

2 Answers

In that page's template, do something like...

if(!is_user_logged_in()){
    $redirect = get_permalink(1); // where this integer is id of registration page 
    wp_redirect($redirect);
    exit;
}
share|improve this answer
    
+1 but could be done much earlier. template_redirect hook for e.g. –  kaiser Nov 4 '13 at 20:15
    
I went to pages, and clicked on the "text" editor for that page, and input that above code, but it didn't work. Am I missing something? (I'm a noob with WP customizations)... –  webfrogs Nov 4 '13 at 21:36
    
No. You're not going to solve this without writing some code. Sounds like you're just looking for a plugin, in which case I can't help you. –  GhostToast Nov 4 '13 at 22:36
add comment

Then, you could try the Quick Page Post Redirect Plugin. Looking at the screenshots, it gives you rather granular functionality for redirection.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.