Home › Forums › Calendar Products › Events Calendar PRO › mini-calendar
- This topic has 6 replies, 4 voices, and was last updated 9 years, 5 months ago by
AUDREY.
-
AuthorPosts
-
November 4, 2016 at 12:26 am #1187572
AUDREY
ParticipantHello,
i’ve the same probleme : https://theeventscalendar.com/support/forums/topic/event-calendar-pro-default-date-for-mini-calendar-widget/
Is it possible to make the widget default to today’s date when the user first goes to the page?
Thanks,
AudreyNovember 4, 2016 at 4:25 pm #1188014Nico
MemberHi there Audrey,
Thanks for getting in touch with us!
Unfortunately there’s not way of doing this via settings 🙁 But if you want I can help you getting started with a javascript snippet to select it once the page has loaded. Do you think that might work for you?
Please let me know about it,
Best,
NicoNovember 4, 2016 at 9:18 pm #1188070AUDREY
ParticipantHi,
Ok but I do not know much javascript!
Thank,
AudreyNovember 7, 2016 at 5:20 pm #1188873Nico
MemberThanks for following up Audrey! No problem I can take care of the coding, in fact I just did some tests and I have a basic working version. I just need to clean it up a bit and I’ll share with you tomorrow.
Best,
NicoNovember 11, 2016 at 2:09 pm #1191181Nico
MemberHey Audrey!
Thanks for the patience while I worked on this 🙂
Paste the following code in your theme’s (or child theme’s) functions.php file:
/* Tribe, load today's events in the minicalendar if any */
function tribe_hack_mini_calendar_widget() {
?>
<script type="text/javascript" >
jQuery(document).ready(function ($){$('.tribe_mini_calendar_widget').addClass('hidelist');
function after_mini_calendar_init(){
if( $('.tribe-mini-calendar .tribe-events-present a').length ) {
$('.tribe-mini-calendar-list-wrapper').html('');
$('.tribe-mini-calendar .tribe-events-present a').click();
}$('.tribe_mini_calendar_widget').removeClass('hidelist');
}window.setTimeout(after_mini_calendar_init, 100);
});
</script>
<style>
.hidelist .tribe-mini-calendar-list-wrapper {
display: none;
}
</style>
<?php
}
add_action('wp_head', 'tribe_hack_mini_calendar_widget');
If the current day doesn’t have any events, the default list with upcoming events will be shown.
Please let me know if it works for you,
Best,
NicoDecember 3, 2016 at 8:35 am #1201223Support Droid
KeymasterHey 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 ‘mini-calendar’ is closed to new replies.
