mini-calendar

Home Forums Calendar Products Events Calendar PRO mini-calendar

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1187572
    AUDREY
    Participant

    Hello,
    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,
    Audrey

    #1188014
    Nico
    Member

    Hi 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,
    Nico

    #1188070
    AUDREY
    Participant

    Hi,
    Ok but I do not know much javascript!
    Thank,
    Audrey

    #1188873
    Nico
    Member

    Thanks 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,
    Nico

    #1191181
    Nico
    Member

    Hey 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,
    Nico

    #1201223
    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 6 posts - 1 through 6 (of 6 total)
  • The topic ‘mini-calendar’ is closed to new replies.