Events List Widget – Display event 30 days from now

Home Forums Calendar Products Events Calendar PRO Events List Widget – Display event 30 days from now

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1159917
    Paul
    Participant

    Hello,

    In this thread:

    Events List Widget – Exclude event in progress?


    I asked if it was possible to display the next event, but not the one which might already be in progress.

    I never really followed this one up but my client has reminded me that they are still interested in this feature. More specifically, if it would be possible to show an event say 30 days from the current date. For example, exclude events in the next 30 days from being displayed and only the next event(s) would be shown.

    I have a dev site and can test away without fear of bringing the entire internet and world to an end! How I would go about testing this idea and snippet of code out…

    To begin, am I right in assuming a copy of the list-widget.php file found here:
    wp-content/plugins/events-calendar-pro/src/views/pro/widgets
    should be uploaded to:
    wp-content/themes/my_child_theme/tribe-events/widgets/
    and then the snippet of code in the previous post be inserted into to the child theme list-widget.php?

    Any guidance would be greatly appreciated.

    Kind regards,

    Paul.

    #1160507
    Josh
    Participant

    Hey Paul,

    Thanks for following up with us here!

    It’s great that you have a dev site already set up here that you’ll be able to work with here! We don’t want any of those “typing Google into Google” errors happening here 🙂

    You can modify this by using the “tribe_events_list_widget_query_args” filter to filter the default “tribe_get_events” function that is pulling the events for the widget.

    Try giving the following snippet a try by adding it into your theme’s functions.php file. You wouldn’t need to copy the widget template into your theme using this approach.

    https://gist.github.com/BeardedGinger/ea60931dd8dae7818465727f090e784f

    Let me know if this helps.

    Thanks!

     

    #1160796
    Paul
    Participant

    Josh, your code worked fantastically on my dev site, and as a bonus, the internet still seems to be working!

    As we all know, typing Google into Google can have catastrophic consequences, so you will be pleased to hear I refrained from doing so 🙂

    I can’t thank you enough for your code snippet which works perfectly. Many thanks and thanks again… and another… thanks!

    Best regards,
    Paul.

    #1160939
    Josh
    Participant

    Hey Paul,

    No problem, happy to help! 🙂

    And I’m a rebel, I immediately searched for Google (insert evil laugh here) 🙂

    I’ll go ahead and close this thread for now. If you have any further questions, please don’t hesitate to open a new one.

    Thanks!

     

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Events List Widget – Display event 30 days from now’ is closed to new replies.