Home › Forums › Calendar Products › Events Calendar PRO › Upcoming Events Widget — Events in Same Month but Different Year Display Day
- This topic has 4 replies, 3 voices, and was last updated 4 years, 6 months ago by Jennifer.
-
AuthorPosts
-
September 10, 2018 at 8:08 am #1617561sixpasturesParticipant
I am using Events Calendar Pro, and have the Upcoming Events widget on this page:
I understand that the default behavior of this plugin is to display the name of the day instead of month in the “month/day” box if the event is in the same month when viewed. However, you can see that the event that is set for Sept 2019 is also showing the name of the day “Sat” instead of the month “Sep”. How can I get events in Sept 2019 to display month name instead of day name?
September 11, 2018 at 6:37 am #1618401JeremyKeymasterHi,
Thanks for reaching out to us! I’d be happy to help you 🙂
Well, in order to display the month instead of the day in your Upcoming Events widget, you would have to customize our templates files. Before doing anything, I would recommend you to read carefully our Themer’s Guide.
Once you’re ready, you can copy the file located at wp-plugins/events-calendar-pro/src/views/pro/widgets/modules/single-events.php
Then, you can override this template in your own theme by creating a file at [your-theme]/tribe-events/pro/widgets/modules/single-event.php
You will have to remove the following condition:
<?php if ( isset( $instance['tribe_is_list_widget'] ) && date( 'm', $post_date ) != date( 'm', current_time( 'timestamp' ) ) ) : ?> <span class="list-dayname"> <?php echo apply_filters( 'tribe-mini_helper_tribe_events_ajax_list_dayname', date_i18n( 'M', $post_date ), $post_date, $mini_cal_event_atts['class'] ); ?> </span> <?php else: ?> <span class="list-dayname"> <?php echo apply_filters( 'tribe-mini_helper_tribe_events_ajax_list_dayname', date_i18n( 'D', $post_date ), $post_date, $mini_cal_event_atts['class'] ); ?> </span> <?php endif; ?>
You will just need to display the following span:
<span class="list-dayname"> <?php echo apply_filters( 'tribe-mini_helper_tribe_events_ajax_list_dayname', date_i18n( 'M', $post_date ), $post_date, $mini_cal_event_atts['class'] ); ?> </span>
I hope this helps.
Cheers,
JeremySeptember 11, 2018 at 7:49 am #1618471sixpasturesParticipantSo, just so I understand, you’re saying that the expected behavior is for events in September 2019 to display day name instead of month name in the Upcoming Events widget? I understand that is the expected behavior for events in September 2018 (at the time of this post that is the current month) but it seems like a bug to me that it would also cause that behavior in September of the following year as well…
If I make the code changes outlined above, will it stop the day name from showing in both September 2018 and 2019 events, or just 2019? I don’t want to stop the intended behavior for the current month, just the somewhat confusing change happening to Sept 2019 events.
September 12, 2018 at 1:36 am #1619268JeremyKeymasterHi,
You are absolutely right, this is a bug. I have just attached your ticket to the bug report and I will set this thread as “Pending fix”, so that we could warn you as soon as the problem is resolved 🙂
Meanwhile, you may use the following snippet to override the template until this is fixed in the plugin:
Copy the file from:
https://gist.github.com/skyshab/9771462a81705b515527e75ce3953addinto [your-theme]/tribe-events/pro/widgets/modules/single-event.php
I hope this helps! Please let me know if you have any other questions in the meantime.
Thank you for your patience and understanding.
Cheers,
JeremySeptember 26, 2019 at 5:45 pm #1882818JenniferKeymasterHello,
Just wanted to let you know that a new maintenance release is out, including a permanent fix for this issue with the list widget.
Find out more about this release → https://theeventscalendar.com/announcing-the-events-calendar-4-9-9-and-events-calendar-pro-4-7-8/
Please try updating and let us know if you are experiencing any further issues. As always, we recommend running updates on your staging site before doing so on your live site, just to be on the safe side.
Thanks again for your patience while we worked on getting this fixed!
Jennifer
October 18, 2019 at 9:35 am #1896301Support DroidKeymasterHey 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 -
AuthorPosts
- The topic ‘Upcoming Events Widget — Events in Same Month but Different Year Display Day’ is closed to new replies.