我已经搜索了这个问题的答案,使用了插件,但仍然没有任何效果。我希望我网站的用户在登录/注册后被重定向到主页。
目前,用户登录并被重定向到我的帐户页面。
Woocommerce 提供了此代码,但它对我不起作用:
/*
* goes in theme functions.php or a custom plugin
*
* By default login goes to my account
**/
add_filter('woocommerce_login_widget_redirect', 'custom_login_redirect');
function custom_login_redirect( $redirect_to ) {
$redirect_to = 'http://anypage.com';
}
我也尝试使用 Peter's Redirect 插件,但由于 woocommerce 绕过 wp-login.php,它不起作用。
想法?