我有以下代碼,我期待它做的是找到我使用的主題,並將該路徑放置在/images/bg.png之前,直到我剛剛獲得的位置是localhost/nameoffolder /圖片/ bg.png,但我想要的是本地主機/ nameoffolder /可溼性粉劑內容/主題/圖片/ bg.pngwordpress get_template_directory
<img src="<?php get_template_directory(); ?>/images/bg.png"></img>
這是我想顯示 http://localhost:8888/fiftyfity/wp-content/themes/fiftyfity/images/
爲我工作!謝謝 –