How To Login, Logout Redirect to Home Page in WooCommerce? | Login, Logout Redirect to Another Page in wordpress
In this post we are learn about How Once a user is in their My Account page on WooCommerce want them to log out and be redirected to my home page instead of ending up on the login page.
इस पोस्ट में हम इस बारे में जानेंगे कि कैसे एक बार उपयोगकर्ता WooCommerce पर अपने माई अकाउंट पेज में होता है और चाहता है कि वे लॉग आउट करें और लॉगिन पेज पर समाप्त होने के बजाय मेरे होम पेज पर रीडायरेक्ट हो जाएं।
Steps To Logout Redirect to Home Page In WooCommerce
1. Copy this code:
add_action('wp_logout','auto_redirect_after_logout');function auto_redirect_after_logout(){wp_redirect( home_url() );exit();}
2. Add your home page url in above code:
wp_redirect( home_url() );
3. Go WordPress dashboard.
4. In appearance choose Theme file Editor option.
5. Choose function.php file.
6. Add above code at the end.
Steps To Login Redirect to Home Page In WooCommerce
1. Copy this code:
add_filter('woocommerce_login_redirect', 'login_redirect');function login_redirect($redirect_to) {return home_url();}
2. Go WordPress dashboard.
3. In appearance choose Theme file Editor option.
4. Choose function.php file.
5. Add above code at the end.
Please do not entering spam link in the comment box ConversionConversion EmoticonEmoticon