search

Home  >  Q&A  >  body text

How to get two hrefs with condition in button using php?

On my page I have a button linked to a form. Now, even if the page is in Spanish, it links to the English version. Is it possible to add a condition such that if English version => link to the English version of the form and if Spanish version link to the Spanish form? On this button<a href="/apply/" class="btn btn-light mt-5 pr-5 pl-5"><?php _e("Let's Grow", "mywebsite" ); ?></a> The Spanish link is /aplicar/

Thank you in advance!

<div class="banner bg-purple">
   <div class="container">
     <div class="row d-flex align-items-center m-h-400 bg-img-building-blocks">
    <div class="col-6"></div>
       <div class="col-6">
         <h3><?php _e("we believe your potential", "mywebsite"); ?><br/><?php _e("is good business", "mywebsite"); ?>.</h3>
        <a href="/apply/" class="btn btn-light mt-5 pr-5 pl-5"><?php _e("Let's Grow", "mywebsite"); ?></a>
          </div>
        </div>
        </div>
          </div>

P粉320361201P粉320361201283 days ago510

reply all(1)I'll reply

  • P粉832490510

    P粉8324905102024-02-22 09:18:43

    You can use get_locale():

    
    

    reply
    0
  • Cancelreply