- This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
Viewing 7 posts - 1 through 7 (of 7 total)
- The forum ‘Back End’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
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??
What’s the result using var_dump($thumburl);
or var_dump($thumb);
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??
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.
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.
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)
?
On to something else now and no time to relook at this at the moment, sorry.