我昨晚熬夜试图解决这个问题并且无法做到这一点。寻求帮助,谢谢!
网站:http://www.localjoeservices.com
通过点击" +创建您的个人资料/登录"注册/登录后,尝试将用户重定向到特定的URL;在右上角的菜单中。
WooCommerce默认为/ my-account /所以我做了一些研究,发现了一个名为Peter的登录重定向的插件,但我似乎无法正常运行。
< / LI>使用WP Job Manager&amp ;;运行Listify Wordpress主题WooCommerce。
默认用户角色设为 客户
-------- 到目前为止我尝试了什么 -----------
a)将其添加到functions.php
add_filter('woocommerce_login_redirect', 'wc_login_redirect');
function wc_login_redirect( $redirect_to ) {
$redirect_to = 'http://localjoeservices.com/add-my-listing';
return $redirect_to;
}
&#13;
b)还尝试使用Peter的登录重定向插件,其中包含以下设置:
Peter's Login Redirect - settings screenshot 2
c)尝试使用Code Snippets插件添加它:
// After registration, redirect to home page
function custom_registration_redirect() {
return home_url(‘/add-your-listing’);
}
add_filter(‘woocommerce_registration_redirect’, ‘custom_registration_redirect’, 20);
&#13;
我正在检查ajax登录弹出窗口中的代码,并看到此代码附加到 注册 按钮:
<p class="woocomerce-FormRow form-row">
<input type="hidden" value="14b8334ba1" name="woocommerce-register-nonce" id="woocommerce-register-nonce"><input type="hidden" value="/my-account/" name="_wp_http_referer">
<input type="submit" value="Register" name="register" class="woocommerce-Button button">
</p>
&#13;
它显示value="/my-account/"
,这可能是其他方法无法解决的问题吗?
真的很感激反馈!