How to redirect logged out users to my custom login page instead of the WPCargo login page?

Copy and paste following codes on your child theme’s functions.php file. Change the page-slug into you custom login page’s slug.

//Redirect to a different login page instead of WPCFE dashboard login
add_action( 'template_redirect', 'custom_login_redirect' );
function custom_login_redirect() {
	global $post;
	if ( $post->ID == wpcfe_admin_page() && ! is_user_logged_in() ) {
		wp_redirect( home_url('page-slug'), 301 ); 
		exit;
	}
}
0
    0
    Your Cart
    Your cart is emptyReturn to Shop