开发者

How to pull out image url on a page in wordpress?

Does anyone know how to pull out the url of the image in wordpress so it can be used as a refrence in the script? I need to pull开发者_StackOverflow社区 them dynamically. However when I'm using postimage(); it pulls out this:

<a href="address">
<img width="300" height="300" src="image.png" class="image" alt="" title="LINKING"/>
</a>

I'm only interested in src. Does anyone know how to pull it out? Thx in advance


You can use this code in the loop:

$thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID));
echo $thumbnail[0];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜