replacing full image with thumbnail in Photo list view
-
Leaving the full feature image in the photo view can make your site very slow as it has to download the full image for ever event. Replacing that image on the Photo list view with a smaller image will help improve your page load speed.
But this surprisingly enough is not something Events Calendar Pro can do out of the box and you need to make a custom override.
To do this you need to copy the original file that creates the Photo list eevnt view.
You will find it here: plugins > events-calendar-pro > src > view > v2 > photo > event.php
Create a copy of this file and put it in your theme folder here:
YOUR-THEME > tribe > events > v2 > photoOpen the file and locate this bit of code
<?php $this->template( 'photo/event/featured-image', [ 'event' => $event ] ); ?>
and replace with this
<?php echo tribe_event_featured_image( $event->ID, 'thumbnail' ); ?>
You can replace the word ‘thumbnail’ with ‘meduim’ or ‘large’ to use the default WordPress media settings you have set here: settings > media
Hope this helps others
- The topic ‘replacing full image with thumbnail in Photo list view’ is closed to new replies.