2011-11-29 59 views
0

我需要這個PHP函數添加:PHP函數添加到字符串

<?php _e("[:en]Read more[:cy]Darllen Mwy"); ?> 

這個字符串:

$more = '<span class="excerpt-read-more"><a class="more-link" href="' . get_permalink() . '" title="' . the_title_attribute('echo=0') . '"><br />Read More &raquo;</a></span>'; 

頂部PHP函數有關應取代「更多»」的位底部的字符串。

我是垃圾在PHP和不斷收到語法錯誤或什麼都沒有。

+0

對不起,什麼?你的意思是你想要在鏈接中打印PHP函數的代碼嗎?或者打印結果?或者點擊PHP函數的鏈接調用?還是其他什麼東西?請詳細說明你想要的最終結果是... – DaveRandom

+0

詳細說明翻譯。 –

+0

您已經將函數的輸出添加到字符串中。你不能用另一個做? – Bojangles

回答

0

老實說,我不知道如果這是連你問什麼,但:

$more = '<span class="excerpt-read-more"><a class="more-link" href="' . get_permalink() . '" title="' . the_title_attribute('echo=0') . '"><br />' . _e("[:en]Read more[:cy]Darllen Mqy") . ' &raquo;</a></span>'; 

似乎是你想要的..

+0

我想最終得到的是「閱讀更多」鏈接,以不同的語言顯示,具體取決於網站的瀏覽語言。我在WordPress上使用qTranslate,並使用該功能來確定。我嘗試了什麼建議,它只是顯示>>不是閱讀更多的任何語言。 –

+0

聽起來好像你的_e()函數工作不正常。我沒有qTranslate的經驗,所以我在這裏幫不了什麼忙。 –

0

我想你想要這樣的:

$more = '<span class="excerpt-read-more"><a class="more-link" href="' 
     . get_permalink() 
     . '" title="' 
     . the_title_attribute('echo=0') 
     . '"><br />' 
     . _e("[:en]Read more[:cy]Darllen Mwy") 
     . ' &raquo;</a></span>'; 

但是說實話,你的問題不是很清楚你想要什麼,所以可能不會給你後面的結果......

+0

對不起,我不清楚。 –