• Resolved jamieson2504

    (@jamieson2504)


    After recently updating our client to the newest versions of Events Calendar and Events Calendar Pro, it looks like featured events are no longer showing within the calendar on initial page load (regular events load fine).

    We’ve added the calendar within a wordpress template with the shortcode [tribe_events category="examplecategory"] which outputs as a monthly calendar.

    As soon as you start navigating through the months, the featured events start showing again after refreshing with AJAX.

    Is there a simple fix for this?

    Cheers

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter jamieson2504

    (@jamieson2504)

    Hi,

    Just following up on this thread after the latest plugin updates.

    We’re still experiencing this issue on our client’s site. When the page loads the calendar shortcode loads the calendar in but not with any featured events — these only start to display when the calendar is reloaded using AJAX when changing the filter/month.

    We’ve added a temporary fix using jQuery which triggers the filter to reload the calendar on page load so the featured events show up to the user. Something like the below:

    <script type="text/javascript">
      // On full page load
      $(window).load(function(){
        //gets todays date
        var fullDate = new Date();
        //transforms the date into the format required for our monthly filter
        // get month (e.g. May will be 05)
        var twoDigitMonth = ((fullDate.getMonth().length+1) === 1)? (fullDate.getMonth()+1) : '0' + (fullDate.getMonth()+1);
        // get year (yyyy - e.g. 2019)
        var fullYear = fullDate.getFullYear();
        // add the month and year to the date filter (e.g. 2019-05)
        $('input#tribe-bar-date').val(fullYear+"-"+twoDigitMonth);
        //trigger the filter button click to reload the calendar with AJAX
        $('.tribe-bar-submit input').trigger( "click" );
      });
    </script>

    However, this is just a workaround, the bug is still present. Would anybody be able to assist?

    Thanks

    @jamieson2504

    You are a life saver. Kudos!

    Thread Starter jamieson2504

    (@jamieson2504)

    No problem @aamirhs ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Featured events not showing on initial page load’ is closed to new replies.