Wordpress:从post.php检索图像url
我需要从post.php页面检索图像url。 我添加了一个脚本(html2pdf),每次编辑或创建帖子时,都会从帖子中创建一个pdf(仅限后台),而且我还必须包含图片的URL。。。但是我找不到办法得到它们Wordpress:从post.php检索图像url,wordpress,image,url,Wordpress,Image,Url,我需要从post.php页面检索图像url。 我添加了一个脚本(html2pdf),每次编辑或创建帖子时,都会从帖子中创建一个pdf(仅限后台),而且我还必须包含图片的URL。。。但是我找不到办法得到它们 提前感谢wp\u get\u attachment\u url和类似的其他内容,但如果我使用其中一个,我的post.php页面将变为空白。我的意思是,即使我试图给一个变量赋值(例如:$testvar=wp\u get\u attachment\u url($post->ID)),页面也不会工作
提前感谢wp\u get\u attachment\u url和类似的其他内容,但如果我使用其中一个,我的post.php页面将变为空白。我的意思是,即使我试图给一个变量赋值(例如:$testvar=wp\u get\u attachment\u url($post->ID)),页面也不会工作。此外,$post->ID似乎未设置…打印什么?$post;返回?