• Hello,
    I wanted to add some code to my child theme’s functions.php in order to redirect visitors to the login page.
    When i use the code in my main theme’s functions.php it works properly. but when i try it with the child theme, it seems that the code is simply ignored.

    <?php
    if( (!is_user_logged_in()) && ($GLOBALS['pagenow'] !== 'wp-login.php')  ) {
      wp_redirect('https://xxxxxxxxxxx.com/wp-login.php');
    }
    ?>

    So does anyone know how to fix this little issue? ??

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Functions.php in child theme not working’ is closed to new replies.