Home › Forums › Welcome! › Pre-Sales Questions › Adding more than 1 photo in Month view
- This topic has 5 replies, 1 voice, and was last updated 10 years, 9 months ago by
Geoff.
-
AuthorPosts
-
August 3, 2015 at 6:01 am #992658
Trisha Hanke
GuestI am doing work on a paint party website, and I’d like to use Event Calendar Pro + Woo Tickets. The only problem is that we need each event to show the featured image in the month view. I read how to add 1 featured image to the month view, but there are days when 3-4 events happen on the same day and we need a photo to show for each in month view…here is as n example of what we’re trying to do: http://www.pinotspalette.com/chesterfield/classes
Please let me know if this is possible, and if so how to do it. Thank you!
August 3, 2015 at 11:46 am #992836Geoff
MemberHi Trisha and thanks for getting in touch! I hope The Events Calendar and WooCommerce Tickets wind up being the right fit for the site you’re working on. 🙂
Good question and nice work finding this tutorial as a starting point. You can certainly edit the code in that tutorial to display the featured images for all events on a particular day, regardless of whether there is more than one event, which would look something like this:
<?php if ( has_post_thumbnail() ?> <div class="tribe-events-event-thumb"><?php echo get_the_post_thumbnail( $post->ID, array(90,90) );?></div> <?php endif; ?>Does this help answer your question? Please feel free to let me me know if you have any follow-up questions here and I’d be happy to help as best I can. 🙂
Cheers!
GeoffAugust 4, 2015 at 1:55 pm #993230Trisha
GuestThis code did not work – the original code in the tutorial works perfectly:
<?php if ( has_post_thumbnail() && 1 == $day[‘total_events’] ) : ?>
<div class=”tribe-events-event-thumb”><?php echo get_the_post_thumbnail( $post->ID, array(90,90) );?></div>
<?php endif; ?>…but this code only displays one events thumbnail image. So I just need to know how to tweak this code above to make all events each day show thumbnails in month view. Thank you again for your assistance!
August 4, 2015 at 4:20 pm #993266Geoff
MemberHi Trisha,
My snippet is a tweak to the original snippet from the tutorial but had a typo:
<?php if ( has_post_thumbnail() ) ?> <div class="tribe-events-event-thumb"><?php echo get_the_post_thumbnail( $post->ID, array(90,90) );?></div> <?php endif; ?>Cheers!
GeoffAugust 4, 2015 at 5:13 pm #993279Trisha
GuestThanks Geoff.
Got it to work…just one more typo in the code, for whoever might need it in the future. It was just missing the : in the first line of code. Thank you so much for your help!!
Here is the working code:
<?php if ( has_post_thumbnail() ) : ?>
<div class=”tribe-events-event-thumb”><?php echo get_the_post_thumbnail( $post->ID, array(90,90) );?></div>
<?php endif; ?>August 5, 2015 at 7:48 am #993423Geoff
MemberAh shoot! So sorry for my poor typing and thanks so much for sharing the correct code with us here. I’m stoked to hear you got this to work smoothly–nice going!
I’ll go ahead and close this thread but please do feel free to hit us back up if any other questions come up–we’d be happy to help. 🙂
Cheers!
Geoff -
AuthorPosts
- The topic ‘Adding more than 1 photo in Month view’ is closed to new replies.
