• Resolved topes

    (@topes)


    HEllo! I am trying to reedirect woocommerce account page if the users are not logged in. I tried to add learnpress suggested code to theme fuction.php, but it does not work. What am I doing wrong?

    This is the code:

    function loginpress_woo_login() {
    if ( function_exists( ‘is_account_page’ ) ) {
    if ( ! is_user_logged_in() && is_account_page() ) {
    wp_redirect(wp_login_url());
    exit;
    }
    }
    }

    add_action( ‘wp’, ‘loginpress_woo_login’ );

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Redirect woocommerce account’ is closed to new replies.