Is my understanding correct that if i specify a custom image size in a view like this
[wpv-post-featured-image size="custom" width="300"]
that Toolset will dynamically generate that image in that size?
I have an issue on this page hidden link where for some reason a single image (the one for Magic) isnt getting created- the other images on the page all generated by the same view are all ok
The page source shows a correctly generated image tag- but the image isn't in the file system
<img loading="lazy" class="attachment-300x size-300x" src="hidden link" width="300" height="" alt="Magic">
When using custom image sizes a new image file is generated in the uploads directory in the same location as the original.
Depending on whether it was generated via an Image block, a types custom field, or—in your case—the wpv-post-featured-image shortcode, the filename will be different.
When resized by the types shortcode, a wpcf- prefix is used. Using the wpv-post-featured-image shortcode uses a wpv- prefix. When generated by an Image block there is no prefix and the same naming convention as WordPress is used.
The screenshot shows my uploads directory where I just output an existing image at a custom size (width = 321) using the wpv-post-featured-image shortcode, and you can see the resulting file.
Are you sure there is no such file in your uploads directory? When I've looked into this before, if it was not possible to generate the custom sized file for some reason, then the img tag would use the full-sized file as its src.
Could there be any other plugins interfering in this?
Thanks Nigel Yes ive just double checked in the file manager and the image
<img loading="lazy" class="attachment-300x size-300x" src="hidden link" width="300" height="" alt="Magic">
is non existent
Adjacent images on that page- that are created by the same view exist where they should
If i deactivate all the other plugins beside toolsets and re add the featured image the problem persists- though what is it that triggers the image creation- perhaps thats not a fair test
I assume we are talking the original image file of your website: hidden link
I have tried it in my localhost with a fresh WP installation + the latest version of Toolset plugins, by below steps:
1) Create a new post and setup the featured image as above image file
2) Use the same shortcode as you mentioned above:
[wpv-post-featured-image size="custom" width="300"]
Thanks, Your right the short code works fine on a page by itself and as i mentioned it worked fine on other posts using that view- so it must be that image perhaps. In any case i resized and renamed the image outside of wordpress and put it in place in the correct path which solved the issue for now.
I guess i wont spend any more of either of out times on it unless it happens again.