Featured Images displaying differently in different widgets

Home Forums Calendar Products Events Calendar PRO Featured Images displaying differently in different widgets

Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • #1431298
    Raymond Gillespie
    Participant

    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?

    #1432818

    Hi 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

    #1432836
    Raymond Gillespie
    Participant

    Hi 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?

    #1433025
    Victor
    Keymaster

    Hi 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,
    Victor

    #1433258
    Raymond Gillespie
    Participant

    Hi 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?

    #1433893
    Victor
    Keymaster

    Hi 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,
    Victor

    #1438361
    Raymond Gillespie
    Participant

    Hello,

    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?

    #1446688
    Victor
    Keymaster

    Hi 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,
    Victor

    #1447006
    Raymond Gillespie
    Participant

    Hi 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?

    #1447464
    Victor
    Keymaster

    Hi 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,
    Victor

     

    #1447521
    Raymond Gillespie
    Participant

    Hello,

    Thanks for the update. I set this up as a widget (see attached). It shows up in the default Sidebar widget area.

    #1448730
    Victor
    Keymaster

    Hi 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,
    Victor

    #1448792
    Raymond Gillespie
    Participant

    Hello,

    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?

    #1448843
    Victor
    Keymaster

    That 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.

    #1448874
    Raymond Gillespie
    Participant

    Thanks Victor, I will give it a go 🙂

Viewing 15 posts - 1 through 15 (of 18 total)
  • The topic ‘Featured Images displaying differently in different widgets’ is closed to new replies.