2017-01-23 27 views
0

我試圖添加一個鏈接在一些PHP文本顯示在由woo commerce發送的電子郵件中。我想添加一個鏈接到我的網站,以便在下面說XXXXX的地方,它說'在這裏。「但是我必須在代碼崩潰時做出錯誤的事情,並且不能正確地讀取所有我想要的各種東西,例如打印和回顯。在顯示的文本中添加http鏈接 - PHP(WooCommerce電子郵件)

<p><?php _e("Your order has been received and is now being processed. We will send you another email shortly to let you know that your order has been shipped. If you'd like to track the status of your order, you can by clicking XXXXXXX. Your order details are shown below for your reference:", 'woocommerce'); ?></p> 

謝謝!

+0

,你試過沒有使用'echo'來打印字符串?即將該字符串直接放在HTML上:'

您的訂單...點擊XXXXX。您的訂單...

'。 – CPHPython

+0

如果您確實需要在Wordpress中使用['_e'](https://codex.wordpress.org/Function_Reference/_e)來根據第二個參數中提供的域來翻譯字符串,請嘗試瞭解崩潰是與'$ domain'相關(在你的情況下'woocommerce')。如果您確切描述了您嘗試放置該鏈接的內容以及「代碼崩潰」時是否有任何錯誤,則此問題可能很有用。 – CPHPython

回答

0

取而代之的是,你可以把你的字符串兩個部分像下面

<p><?php _e("Your order has been received and is now being processed. We will send you another email shortly to let you know that your order has been shipped. If you'd like to track the status of your order, you can by clicking ", 'woocommerce'); ?><a href="http://example.com" title="">XXXXXXX</a><?php _e("Your order details are shown below for your reference:", 'woocommerce'); ?></p> 
相關問題