Is there a theme function (or Wordpress function) that will let me get the URL of the (first) featured image associated with the post, when I am in the single post view?
Retrieving URL of featured image for a post, in single post view?
6 posts from 2 voices-
Posted 1 year ago #
-
Yes - you can use following code to get the first featured image - if you replace [0] with [1] you'll get the second and so on:
$slides = avia_post_meta($post->post_id, 'slideshow'); if ($slides){ $postimage = avia_image_by_id($slides[0]['slideshow_image'],'thumbnail',$output = 'url'); echo $postimage; }You can replace "thumbnail" with another image size too...
Posted 1 year ago # -
Hi Dude,
The code you gave me displays the image. I don't want to display it, I just want the URL.
Help?
- Lily
Posted 1 year ago # -
I changed the code. Only the url will be returned now.
Posted 1 year ago # -
Thank you :)
How do I set the size of the thumbnail in the theme/Wordpress settings?Posted 1 year ago # -
Hey!
You can change the slideshow/image dimensions in functions.php (I'd only adjust the height value). Afterwards regenerate the thumbnails with: http://wordpress.org/extend/plugins/regenerate-thumbnails/
Regards,
PeterPosted 1 year ago #
Reply
You must log in to post.














