If you have troubles since the update to WordPress 4.5 please read this post before opening a new thread.
Tagged: post image
I need to get the URL to the post image.
Assume this can be done with $big_prev_image = kriesi_post_thumb( somthing), but how?
The kriesi_post_thumb function calls the image URL and includes it as part of the output. What you’re looking for is this code:
$image_id = get_post_thumbnail_id();
$image_url = wp_get_attachment_image_src($image_id, NULL);
$image_url = $image_url;
You could then echo the $image_url to print the link on the page.
Hope this helps.
The topic ‘How to get URL to post image?’ is closed to new replies.