WordPress.org

Ready to get started?Download WordPress

Forums

excluding reg page (is_user_logged_in) (2 posts)

  1. bryanjlaz
    Member
    Posted 1 year ago #

    I am fairly new to PHP and I am trying to block the site access, redirecting all users/non-users to the wp-login.php page.. THEN on the login page, the non-registered users can still access the registration page.
    I have inserted this code into the theme header and it works great,

    <?php if(!is_user_logged_in()){header("Location: http://WP/wp-login.php");} ?>

    except there is no access to the reg. page, of course.
    What can I add to this code to exclude the registration page, so when the link is clicked, it will at least be viewable and work?

    http://worldwidelogisticsltd.com/intranet/wp-login.php

    Thank you for your help..

  2. bryanjlaz
    Member
    Posted 1 year ago #

    Correct.. The code I inserted is...

    <?php
    if(!is_user_logged_in()){
    header("Location: http://worldwidelogisticsltd.com/intranet/wp-login.php");} ?>

    :)

Topic Closed

This topic has been closed to new replies.

About this Topic