Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/jquery-mobile/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wordpress:从post.php检索图像url_Wordpress_Image_Url - Fatal编程技术网

Wordpress:从post.php检索图像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)),页面也不会工作

我需要从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)),页面也不会工作。此外,$post->ID似乎未设置…打印什么?$post;返回?