Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End WordPress img url not returning

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #185115
    deeve007
    Participant

    I have no idea but this is not working, even though it works fine on another site:

    $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'post-main-small' );
    $thumburl = $thumb['0'];
    echo $thumburl;
    <code></code>

    Anyone know/heard of any possible conflicts/issues that would stop this from working??

    #185117
    chrisburton
    Participant

    What’s the result using var_dump($thumburl); or var_dump($thumb);

    #185119
    deeve007
    Participant

    Debugging suggests it’s to do with excessively large images being used as a featured image on a page/post. I reduced the size of the original image from around 4mb to under 1mb and it worked fine. I wouldn’t normally upload such a large image but was just playing around with some stuff I’m testing, but never heard of this causing an issue like this, anybody else??

    #185120
    chrisburton
    Participant

    The last time I used WordPress I wasn’t able to upload anything above 2 or 3MB (can’t recall) for a featured image. It gave an error message on upload suggesting to reduce the file size.

    Edit: Possibly related.

    #185121
    deeve007
    Participant

    Actually it was only 1.48mb the image that gave the thimbnail problems. So seems there’s a certain size – perhaps on certain serves – that WP allows you to upload, but struggles with displaying the selected thumbnail size. It still creates the thumbnail, checked the server, but was displaying the full size image. Strange.

    #185122
    chrisburton
    Participant

    but struggles with displaying the selected thumbnail size. It still creates the thumbnail, checked the server, but was displaying the full size image. Strange.

    Odd. What happens if you replace post-main-small with array(200,200)?

    #185123
    deeve007
    Participant

    On to something else now and no time to relook at this at the moment, sorry.

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘Back End’ is closed to new topics and replies.