Change Featured Image Size on Single Event

Home Forums Calendar Products Events Calendar PRO Change Featured Image Size on Single Event

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1317191
    Remy
    Participant

    Cannot change featured image size on single event.

    Instead of showing full image, a hard-cropped image appears such as with: https://outbuzz.com/gay-parties/battle-hymn-2017-07-07/ The dimensions do not seem to be a defined image size in the function.php file or in the core WP either (this one is 720×321).

    #1317498
    Mathew
    Participant

    Remy,

    The Enfold theme sets the featured image size to a custom defined size of ‘845×321’ named ‘entry_with_sidebar’ within the /config-events-calendar/views/single-event.php file.

    It appears that you are using a child theme. To override Enfold’s custom size, you can add this conditional filter to the functions.php file within the child theme folder.

    // Change size of featured image on single events
    add_filter( 'post_thumbnail_size', 'custom_single_event_post_thumbnail_size');
    function custom_single_event_post_thumbnail_size($size) {
    if( !is_singular('tribe_events') ) {
    return;
    }
    if( ! has_post_thumbnail() ) {
    return;
    }
    $size = 'full'; // Set desired image size here.
    return $size;
    }

    Hope this helps.

    #1317642
    Shelby
    Participant

    Hi there Remy,

    I’d be happy to help out here!

    Did Mathew’s thoughts help you here? 🙂 Mathew, thanks for jumping in on this one!

    Let me know Remy, and we’ll work this out!

    Best,

    Shelby 🙂

    #1321684
    Remy
    Participant

    Thanks for the help!
    When I use that code it does work, but it also affects thumbnail sizes for the sidebar and not just for TEC single images.

    #1322443
    Shelby
    Participant

    Hi Remy,

    Unfortunately, modifying all of the thumbnails is the only way that I’m aware of to make that change. If you need some more complex custom code, I’d recommend hiring a freelancer to help out. 🙂 We have some ideas about that here.

    Please let me know if you have any follow up questions or need clarification!

    Best,

    Shelby 🙂

    #1322586
    Remy
    Participant

    Hi Shelby,

    Using Enfold, the solution is to create a copy of the single-event.php file in the child theme and change the image size below from ‘entry_with_sidebar’ to ‘full’

    <?php echo tribe_event_featured_image($event_id, ‘full’, false); ?>

    Otherwise you will change the size for every instance site-wide of ‘entry_with_sidebar’ to ‘full’.

    #1323301
    Shelby
    Participant

    Hi there,

    Thanks for sharing your solution here, we appreciate it!

    Best,

    Shelby 🙂

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Change Featured Image Size on Single Event’ is closed to new replies.