Adding daily event count to mini-calendar widget

Home Forums Calendar Products Events Calendar PRO Adding daily event count to mini-calendar widget

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #766721
    bwerner120
    Participant

    Is it possible to add a count of the daily events to the mini-calendar. So, each day in the calendar would show how many events are happening each day?

    I have the new template created, just not sure what code to add. Thanks.

    #769277
    Barry
    Member

    Great question!

    So if you’re overriding pro/widgets/mini-calendar/single-day.php then you should be able to access an array called $day – this contains a total_events index which you could use for this purpose, ie:

    echo $day['total_events'];

    Does that help?

    #776040
    bwerner120
    Participant

    That works for each day. What I am really trying to do is get that to display for each category, for each day. Either via a loop, or if I could query the name of each category manually and output the total that would also work.

    Example of 1 day on the calendar:
    Cat 1 (2 events), Cat 2 (7 events), Cat 3 (3 events)

    I understand this is custom, and any insight would be much much appreciated. Thank you for your help already Barry!

    #776120
    Barry
    Member

    Hi!

    So within the very same array you can find a WP_Query object – $day[‘events’] – and you can access each event object through that and then test to see which if any taxonomy terms are applied.

    Here are some resources you might be interested in:

    This is indeed custom development territory, though, so we’ll really have to leave the rest to you. Good luck – and if we can help with any other issues please don’t hesitate to create new threads as needed.

    Thanks again!

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Adding daily event count to mini-calendar widget’ is closed to new replies.