• I’m tring to get the url of a post featured image in a specific dimension.

    When I need to get all the code of the image I use
    get_the_post_thumbnail($post->ID, 'format');
    and it returns the correct image (image-WIDTHxHEIGHT.ext).

    But I need only the url so I tried with wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'format');
    and it returns an array with the image full size (image.ext) and the 2 dimensions, while I need directly the cropped image (image-WIDTHxHEIGHT.ext).

    Is it possible to retrieve the url of the cropped image without further string concatenation or regex replaces?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Get cropped image url’ is closed to new replies.