0

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?

4
  • your site does not look good on 1024x768
    – user9
    Nov 4, 2013 at 19:22
  • are you okay with a plugin to wordpress, or do you need php code?
    – user9
    Nov 4, 2013 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.
    – Millhorn
    Nov 4, 2013 at 19:35
  • And I'm aware of the resolution issues. Working on it.
    – Millhorn
    Nov 4, 2013 at 19:35

2 Answers 2

1

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;
}
3
  • +1 but could be done much earlier. template_redirect hook for e.g.
    – kaiser
    Nov 4, 2013 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)...
    – Millhorn
    Nov 4, 2013 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, 2013 at 22:36
0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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