简体   繁体   English

在 WooCommerce 登录和注册页面添加自定义文本

[英]Add a custom text in WooCommerce login and registration page

In WooCommerce login/registration page, I try to add a statement "Ask for help" under the login/registration form next to "Forget password?"在 WooCommerce 登录/注册页面中,我尝试在“忘记密码?”旁边的登录/注册表下添加“请求帮助”语句

To let the unregistered user go easily to the "Contact Us" when pressing on this statement.让未注册用户 go 在按下此语句时轻松地“联系我们”。

I guess you could insert an echo.我想你可以插入一个回声。 Something like this if you can locate the position on PHP when your form happens:如果您在表单发生时可以在 PHP 上找到 position,则类似这样的事情:

echo "<p><a href='contactus.html'>Ask for help</a></p>";

It's hard without seeing the code though.没有看到代码很难。 Maybe you can have access to the html form and can edit it from there.也许您可以访问 html 表格并从那里进行编辑。

This will add the link in the appropriate places where Woocommerce provides action hooks:这将在 Woocommerce 提供动作挂钩的适当位置添加链接:

add_action('woocommerce_login_form_end', 'custom_woocommerce_help_link_action');
add_action('woocommerce_after_lost_password_form', 'custom_woocommerce_help_link_action');
function custom_woocommerce_help_link_action() {
    echo '<p class="ask-help"><a href="http://localhost/ask-help">Ask for help</a></p>';
}

Obviously change the link URL to suit and style the paragraph as needed.显然,根据需要更改链接 URL 以适应和设置段落样式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM