Skip Navigation

[Resolved] Fatured image only getting the correct size half the time

This support ticket is created 5 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 2 replies, has 2 voices.

Last updated by jonathanB-19 5 years, 6 months ago.

Assisted by: Beda.

Author
Posts
#1245237

I am trying to use the shortcode [wpv-post-featured-image size="page-header"] which should pull a 1600x464 image with a -1600x464.jpg extension to the URL. This works on some pages, but others are pulling the original (uncropped) image. I checked and all of the images do a have a page-header sized version, which is something I created in my theme and generated with regen thumbnails.

If I use [wpv-post-featured-image size="custom" width="1920" height="464" crop="true"] instead, it works every time. But then I tried to overwrite the 1920x464_center_center.jpg version of the images on my server, and toolset seems to keep overwriting them. I want to custom crop my images in photoshop and then upload them. Every time I refresh I lose them.

#1245306

Intersting, just a few minutes ago I interacted in a similar issue here:
https://toolset.com/forums/topic/custom-size-featured-image-does-not-work/

There, the user cannot pull the resized image, which seems to be non-existing.

However, related to your report, I see you use a Custom Image Size that is registered in the Theme ([wpv-post-featured-image size="page-header"] ).
You mention having ensured the Thumbnails exist for that specific size for all Images, hence, the ShortCode likely should have no reason to fail.

I also tried here, to locally replicate such a scenario, but when I register a custom size with add_image_size(), where crop is true, and upload images to WordPress to later display them with the custom size using Toolset ShortCodes, it works fine.

I am confused about your second paragraph.
Do you upload already cropped, resized Images to WordPress?.
Then, you'd not need to create a new Image Thumbnail size with add_image_size() and call that in the ShortCode, you could just call the Full Image size, as that would already be the (since it's the maximum available) cropped and resized image you uploaded.
What do I misunderstand here? I am sure there is a connection between both which I miss.

Related to the fact that some pages work and some not, I suspect, there is either a setting, a difference in the ShortCode, template, or even the Image, on those posts that work versus those that don't.

As first steps towards a solution, I'd suggest also here to try without any plugins but Toolset and changing the Theme (on a staging site for safety). Then I'd suggest try to narrow down the difference between working, and not working posts if the issue persists.
You can look for templates assigned, other ShortCodes present, eventual broken ShortCodes (maybe apostrophes got corrupted, or similar).

If all this does not help, can you send me a link of A) a working page where only the ShortCode is present (if possible) and B) a not working page, also where only the ShortCode is inserted.
I can then try to narrow it down, or maybe proceed locally with a copy of your site if online I cannot see anything.
In case you want to help expedite that process, you can already create such copy (also a great tool to create Staging sites) following https://toolset.com/faq/provide-supporters-copy-site/
In case that'll be needed, you can find the Private reply mode already active on your next reply here.

#1245381

Thanks for the detailed response. I wound up creating a new custom image size in my theme with slightly different cropping parameters and that seems to have fixed the problem. I think maybe the shortcode just couldn't locate the first set of images because they weren't named properly for some reason.