I need something similiar to the one like you gave on https://xtemos.com/forums/topic/how-can-i-redirect-the-user-in-other-url-when-he-click-create-an-accound/#new-post
but I need it for a login page.
I have created an another login form. So when a user logged in and logout it directs them to http://www.fitovision.net/hesabim which is normal but I want them to be redirected to fitovision.net/login page instead of wordpress default login page.
Is there any function for that?
I found one but it redirects the user to user profile page not my account.
The code I found is:
function redirect_login_page(){
if(is_user_logged_in()){
return;
}
global $post;
// Need for checking if this page equals wp-login.php
// permalink to the custom login page
$login_page = get_permalink( '9255' );
if( has_shortcode($post->post_content, "woocommerce_my_account") ) {
wp_redirect( $login_page );
exit();
}
}
add_action( 'template_redirect','redirect_login_page' );