首页  >  问答  >  正文

如何使用php在按钮中获取带有条件的两个href?

在我的页面上,我有一个链接到表单的按钮。 现在,即使页面是西班牙语,它也链接到英语版本。 是否可以添加一个条件,例如,如果英文版本 => 链接到英文版本表单,如果是西班牙语版本链接到西班牙语表单? 在此按钮上 <a href="/apply/" class="btn btn-light mt-5 pr-5 pl-5"><?php _e("Let's Grow", "mywebsite"); ?></a> 西班牙语链接是/aplicar/

提前谢谢您!

<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粉320361201240 天前450

全部回复(1)我来回复

  • P粉832490510

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

    您可以使用get_locale()

    
    

    回复
    0
  • 取消回复