Skip Navigation

[Resolved] Featured image not loading in Views

This thread is resolved. Here is a description of the problem and solution.

Problem:

The Featured Image Shortcode does not show the correct size.

Solution:

Add the shortcode like this:

[wpv-post-featured-image size="size-img" width="300" height="400" crop="true" cached="off"]

Make sure that you add the image size to your theme functions.php file:

add_image_size( 'size-img', 300, 400, true );

Install the Regenerate Thumbnails plugin and make sure that all the image sizes are generated:

https://wordpress.org/plugins/regenerate-thumbnails/

This support ticket is created 2 years, 10 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.

This topic contains 13 replies, has 2 voices.

Last updated by richardG-4 2 years, 10 months ago.

Assisted by: Christopher Amirian.

Author
Posts
#2282215

I have been using this View for years now, but suddenly the Featured Images stopped loading. They should be loading on this page to the right of the category bar, and to the left of the title and description: hidden link

We have found a temporary solution of creating a new field and copying the featured images over, so I know images are loading, but not the featured image. It's not hidden by CSS or something, if you inspect where the image should be loading, not even the Toolset tag shows up.

I have tried updating my plugins and theme, and changing the theme back to a default theme. I've also tried disabling all themes except for Toolset, and it seems it may be an incompatibility with Elementor, but the whole site is built on Elementor, so I can't disable it without needing to do a total site rebuild. I don't see any errors come up though, so I'm not sure what is going on.

#2282535

Christopher Amirian
Supporter

Languages: English (English )

Hi there,

Would you please do some initial steps?

1. Update Toolset Views to version 3.6.2:

- IMPORTANT STEP! Create a backup of your website.
- Go to "WordPress Dashboard > Plugins > Add new > Commercial (tab)".
- Update Toolset and its addons there.

2. Update Elementor Pro to version 3.6.0:

- IMPORTANT STEP! Create a backup of your website.
Follow the steps below:
hidden link

3. Test without Elementor:

- Create a new page.
- Add a new View and make sure you list the Featured Images.
- See if it works ok without using Elementor.

If you are able to show the Featured Images in step 3, please check the known issues below and see if they apply to your case:

https://toolset.com/errata/elementor-library-widget-content-does-not-appear-on-the-front-end-for-posts-using-a-content-template/

and

https://toolset.com/errata/elementor-pro-template-shortcode-not-rendered-in-view-loop-item/

Thanks.

#2283003

Hi, I tried the above steps, and the featured images still aren't showing. I realized that I have the same issue on another site for the same client, these posts should have a featured image above the title: hidden link

I have everything up to date on both sites. I also tried adding the View using the WordPress Block Editor instead of Elementor, and also disabling Elementor and Elementor Pro, but that didn't work either.

#2285101

Christopher Amirian
Supporter

Languages: English (English )

Hi there,

Thank you for following the steps. Would you please kindly get back to us with the login information of the staging version of your website so that we can check the details?

I'd appreciate it if you give the staging version as if you give us the live version we will not be able to do tests and deactivate plugins and other troubleshooting steps.

If needed, we can give you the means to duplicate your website to our server.

The next reply will have a checkbox to set it as private to share the login info.

Thanks.

#2285425

I wasn't able to mark this as private, what do I do?

#2285681

Christopher Amirian
Supporter

Languages: English (English )

Would you please try now?

#2286843

Christopher Amirian
Supporter

Languages: English (English )

Hi there,

Thank you for the login information. As I checked you used the wrong kind of shortcode for the featured image as you are looping over the product's shortcode.

I added another shortocde and it worked:

[wpv-woo-product-image size="shop_single"]

For more detailed information:

https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#vf-154357

Thank you.

#2286917

Interesting, I wonder why it stopped working.

What about on the KimberAcademyNational.com site, the Instructors View is not a product. I found that if I don't do a custom size then the images work. Why would doing a custom size make my featured images not work on that View, and how do I fix it? I suppose I could remove the custom size and do it with CSS or something, but why would it suddenly stop working?

Do you want access to the Kimber Academy site?

#2287619

Christopher Amirian
Supporter

Languages: English (English )

Hi there,

The reason that you do not see the featured image when you used the custom mode, is that, the custom image size is not defined on your theme.

In the current website dev version, I added the code below to functions.php of your theme to make sure WordPress understands the "custom" file size:

add_image_size( 'custom', 50, 50 );

Now if you check the catalog page you will see that the featured image shortcode works:

hidden link

[wpv-post-featured-image size="custom" width="300" height="400" crop="true" cached="off"]

For more information about the "add_image_size":

https://developer.wordpress.org/reference/functions/add_image_size/

Thank you.

#2290845

I tried that on the Instructors page, and it didn't work properly. The images show up, but they aren't cropping correctly: hidden link

I added the following to a Toolset Custom Code snippet:

add_image_size( 'instructors-img', 300, 400, array( 'center', 'center' ) );

I also tried it with

add_image_size( 'instructors-img', 300, 400, true );

And I added this to the View:

[wpv-post-featured-image size="instructors-img"]

So I'm not sure why this didn't work.

What changed to where we have to add this code to the functions.php now? It must have been a Toolset update because it's not working on multiple themes.

#2291017

Christopher Amirian
Supporter

Languages: English (English )

Hi there,

Would you please use this shortcode instead? (The WordPress function is ok and you can keep it that way)

[wpv-post-featured-image size="instructors-img" width="300" height="400" crop="true" cached="off"]

Thank you.

#2291317

I tried that one first, since I am making this a WordPress media size, it doesn't care what Toolset attributes I add to the shortcode, those are totally ignored.

Just to make sure, I tried copying and pasting what you shared, and it still didn't work.

Do you know what may have been updated with WordPress or Toolset since these Views were created that could cause this bug to begin with? That might help me figure out how to get the images to come up the right way without needing to make a WordPress media size that isn't working properly.

#2291827

Christopher Amirian
Supporter

Languages: English (English )

Hi there,

I am not aware of any code change, and we always had that necessary image size for the use of the featured image shortcode.

Maybe the issue n your website is that the image size that you have created is not still generated for th eimages that you have uploaded beforehand.

There is a plugin that regenerates the thumbnails:

https://wordpress.org/plugins/regenerate-thumbnails/

So would you please install that and make sure that you keep the code at the same situation and make sure that you regenerate your website thumbnails?

See if it has an effect.

Thank you.

#2292165

Okay, I installed the plugin, and also had to install Imagick on my server because I host through Linode (for anyone that comes across this issue), and that actually worked!!

I'm still so confused why the featured images disappeared in the first place, but thank you for sticking through it with me.