0
我想爲上一個和下一個帖子鏈接使用圖像。下面的代碼行被拒絕了,因爲我應該使用get_template_directory_uri()
。我應該如何修改下面的代碼在PHP中包含此功能?WordPress的下一個/上一頁文章鏈接與圖像
<?php next_posts_link('<img src="./wp-content/themes/Icecap/images/next.png" />'); ?>
我想爲上一個和下一個帖子鏈接使用圖像。下面的代碼行被拒絕了,因爲我應該使用get_template_directory_uri()
。我應該如何修改下面的代碼在PHP中包含此功能?WordPress的下一個/上一頁文章鏈接與圖像
<?php next_posts_link('<img src="./wp-content/themes/Icecap/images/next.png" />'); ?>
他們正在討論不使用/wp-content/themes/
等路徑。
所以,這應該工作:
<?php next_posts_link('<img src="'.get_template_directory_uri().'/images/next.png" />'); ?>
謝謝!你必須在末尾添加'?>'來結束嵌入式php,否則會出現語法錯誤。想要修改? '<?php prev_posts_link(''); ?>' – Sayanee
啊,是的,我的壞 - 當我提出答案時走出了門。 – 2012-05-14 00:46:02