Home › Forums › Calendar Products › Events Calendar PRO › Featured Images displaying differently in different widgets
- This topic has 18 replies, 3 voices, and was last updated 6 years, 2 months ago by Raymond Gillespie.
-
AuthorPosts
-
January 20, 2018 at 4:50 am #1431298Raymond GillespieParticipant
Hello,
We’ve noticed that Featured Images show up as full-width images on the Featured Events widget, but they show up as 150px x 150px thumbnails on the Upcoming Events widget. Do you know how we can change this so they both show up as full width?
January 22, 2018 at 1:10 pm #1432818Jaime MarchwinskiKeymasterHi Raymond,
Thanks so much for reaching out!
You can try editing the Featured Images with some CSS and adding that to your WordPress Customizer or theme’s stylesheet.
You can also try a third-party plugin, like this one, which can help you to edit your Featured Images.
Let us know how it goes and if you have any other questions on this topic!
Thanks,
Jaime
January 22, 2018 at 1:25 pm #1432836Raymond GillespieParticipantHi Jaime,
Thanks for the update. What I was hoping to do is actually pull in a different size of featured image – currently, it looks like the 150×150 thumbnail is being loaded for the Upcoming Events, so if I use CSS to enlarge this it will either be cropped again or will be stretched. The Featured Events seem to be able to load a different size of Featured Image, which has the correct aspect ratio, so I’d like to also get this showing for Upcoming Events. Do you know if that’s possible?
January 22, 2018 at 4:17 pm #1433025VictorKeymasterHi Raymond!
Thanks for following up with this topic. Let me further help you with it.
I’m not really sure I know the exact widgets you are referring to. Could you please let me know if you are using the Featured Venue Widget > https://theeventscalendar.com/knowledgebase/configuring-the-featured-venue-widget/ ?
Also, please share with me a link to the pages where I can see the widgets you are using, so I can have a closer inspection and see if I can find a way to achieve what you are looking for.
You can also send us some screenshots.
Thanks,
VictorJanuary 23, 2018 at 1:41 am #1433258Raymond GillespieParticipantHi Victor,
Here’s an example of this:
http://www.themotoringdiary.com/events/list/?tribe_eventcategory=4
If you look in the code you will see that the Featured Events are pulling through the featured image at full size. An example of this is: http://www.themotoringdiary.com/wp-content/uploads/2018/01/Haynes.png
If you look at the non-Featured Events, you will see that their featured images have been cropped to the 150×150 WordPress thumbnails. This is an example:
http://www.themotoringdiary.com/wp-content/uploads/2018/01/NAIA-150×150.jpg
Does that make sense?
January 23, 2018 at 11:47 am #1433893VictorKeymasterHi Raymond!
That makes total sense. Thanks for clearing that out.
That’s totally possible! I would suggest overriding the single-event.php template to make that happen. You can learn more about overriding calendar templates in our Themer’s Guide, but it basically boils down to this:
- Make a copy of the single-event.php template. It is located at wp-content/plugins/the-events-calendar/src/views/list/
- Make a new folder in your theme called tribe-events
- Make a new folder in that one called list
- Drop your copied single-event.php file in that last folder
Now that the template is in your theme, you can modify it to suit your needs. In this case, you want to edit line 86 and modify the code to look like the following:
<?php echo tribe_event_featured_image( null, 'large' ); ?>
Does this work for you? Please let me know. 🙂
Best,
VictorJanuary 28, 2018 at 11:20 am #1438361Raymond GillespieParticipantHello,
Thanks for suggesting this. I have tried that change but it doesn’t seem to work. However, from looking at the code in single-event.php, the instructions you gave were to place the ‘medium’ image size with the ‘large’ image size. The problem I’m having is that the ‘thumbnail’ image size is being used, so I’m guessing that the code on line 86 isn’t part of the issue (otherwise it would say ‘thumbnail’).
Is there anywhere else I can change the code to get the medium or large image loading instead of the thumbnail?
February 7, 2018 at 11:07 am #1446688VictorKeymasterHi Raymond!
Thanks for following up with this.
First, let me apologise for the delay in getting back to you. We’ve been out on our annual team trip and we are slowly getting back to normal response times.
I’ve just realized you might be referring to the widgets images instead of the ones for the list views. You can modify the widget thumbnail size to use the full size by placing the following code into your theme’s functions.php file:
/*
* Set the default post thumbnail size to 'full' for list widget
*/
add_filter( 'tribe_events_list_widget_thumbnail_size', 'custom_list_widget_thumbnail_size' );
function custom_list_widget_thumbnail_size() {
return 'full';
}Please try it out and let me know if it works for you.
Thanks,
VictorFebruary 7, 2018 at 3:20 pm #1447006Raymond GillespieParticipantHi Victor,
Thanks for your reply. That sounds like exactly what we need, but I’ve just tried it out and it doesn’t seem to have made any difference. Do you have any further suggestions?
February 8, 2018 at 4:38 am #1447464VictorKeymasterHi Raymond!
That’s strange. Having a closer inspection, it seems you are using the mini calendar widget in the sidebar. Could you please let me know how you are adding this into your sidebar? is it via a shortcode?
Let me know about it.
Thanks,
VictorFebruary 8, 2018 at 5:45 am #1447521Raymond GillespieParticipantHello,
Thanks for the update. I set this up as a widget (see attached). It shows up in the default Sidebar widget area.
February 9, 2018 at 4:12 am #1448730VictorKeymasterHi Raymond!
I think there might be some template customization for the list widget. You should check if there is a tribe-events folder in your theme which contains a template override for the list-widget.php file or for any of our widgets templates.
You can try the code I sent you in a default theme like twenty seventeen and see if it works. If it does, then it might be that your theme is customizing the widgets templates somehow so you should dig into your theme’s code to modify the thumbnail size.
Let me know about it.
Thanks,
VictorFebruary 9, 2018 at 5:46 am #1448792Raymond GillespieParticipantHello,
The only custom file I have is single-event.php, there is a line that references the image size here:
$thumbnail_size = apply_filters( ‘tribe_events_list_widget_thumbnail_size’, ‘post-thumbnail’ );
Do I overwrite that instead of the functions.php fix?
February 9, 2018 at 6:36 am #1448843VictorKeymasterThat is the exact filter the code snippet is targeting, so it should be working. Still, you could try editing that line to test if anything changes.
If it doesn’t, then you should try switching to a default theme and see if any changes. It could be that your theme is customizing the widget templates in some other way too.
Let me know how it goes.
February 9, 2018 at 6:53 am #1448874Raymond GillespieParticipantThanks Victor, I will give it a go 🙂
-
AuthorPosts
- The topic ‘Featured Images displaying differently in different widgets’ is closed to new replies.