skip to Main Content

I am kinda new with WooCommerce and WordPress overall.
So, I am trying to add some text below to “Lost your password” field at My Account WooCommerce login form, But I did not succeed even though I added p anchor below the forget my password section in the login-form.php file but in fact nothing changed on the page. What am I supposed to do?
Basically, what I want to do is add a text line with a link to another page. I’d like if someone could tell me in which file I should add my code lines and if it possible to do it.


The picture shows what I’m talking about

Thanks.

2

Answers


  1. You can use the “login_footer” hook to add text below “Lost your password” field.
    You can find more hooks in wp-login.php in your wordpress root directory and add text based on your requirements.

    Add Code like this somewhere in child theme functions.php:

    add_action('login_footer', 'add_text_forgot_pass');
    function add_text_forgot_pass(){
        echo "Extra TEXT";
    }
    

    Let us know if you have more questions. Thanks.

    Login or Signup to reply.
  2. You can use below hook to add any thing after login form at WooCommerce My Account page. Add this code to your active theme’s function.php file.

    add_action('woocommerce_after_customer_login_form', 'add_text_after_login');
    
    function add_text_after_login() {
        echo "Custom Content";
    }
    

    woocommerce_after_customer_login_form & woocommerce_before_customer_login_form these two hooks are used to add content after or before login form.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search