Image size in mobile view

Home Forums Calendar Products Events Calendar PRO Image size in mobile view

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1157990
    Greig
    Participant

    I would like the mobile view set up on desktops, so I have set the mobile breakpoint high to force the plugin to always display the mobile view.

    I would then like to change the size of the image displayed to ‘full’ when you click an event date in the calendar. The file I think I need to change is in folder month/mobile.php . I think the code I need to adjust is:

    
    	[[ if(imageSrc.length) { ]]
    			<div class="tribe-events-event-image">
    				<a href="[[=permalink]]" title="[[=title]]">
    					<img src="[[=imageSrc]]" alt="[[=title]]" title="[[=title]]">
    				</a>
    			</div>
    

    Could you let me know how I might be able to do this.

    Thanks

    • This topic was modified 9 years, 7 months ago by Greig.
    #1158441
    Hunter
    Moderator

    Hey Greig,

    Welcome back! Try adding the following snippet to the bottom of your theme’s functions.php file and let me know if it works. Please note, it doesn’t address any CSS.

    function calendar_mobile_month_img_size( $data ) {
    if ( ! isset( $data['eventId'] ) ) return $data;

    if ( has_post_thumbnail( $data['eventId'] ) ) {
    $image_arr = wp_get_attachment_image_src( get_post_thumbnail_id( $data['eventId'] ), 'full' );
    $data['imageSrc'] = $image_arr[ 0 ];
    }

    return $data;
    }

    add_filter( 'tribe_events_template_data_array', 'calendar_mobile_month_img_size' );

    #1167502
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Image size in mobile view’ is closed to new replies.