简体   繁体   中英

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?"

To let the unregistered user go easily to the "Contact Us" when pressing on this statement.

I guess you could insert an echo. Something like this if you can locate the position on PHP when your form happens:

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.

This will add the link in the appropriate places where Woocommerce provides action hooks:

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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