Upcoming

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1222265
    Daniel
    Participant

    Hi,
    on my pages I publish our trainings. The most of them are more month long. So I want to list these events on the homepage, but only the upcoming events. Is it possible to hide the events that already began?

    Thank alot

    Daniel

    #1222889
    Josh
    Participant

    Hey Daniel,

    Thanks for reaching out to us!

    To clarify a couple of things here,

    • How are you wanting to feed the events into your home template? One of our default widgets? Some custom code in your template?
    • For the list, you want to exclude any event where the start date of the event has already passed even if that event is a currently running event?

    Thanks!

    #1222907
    Daniel
    Participant

    Hey Josh,

    thanks for you reply. If possible I would like to feed it with a widged or another solution?
    You are right, I want to exclude every event that has still started. Because our trainings a many month long and the costumers need to complete the whole time of a training.

    Thank you for helping me.

    Daniel

    #1224370
    Josh
    Participant

    Hey Daniel,

    Thanks for following up here!

    Sure thing! You can use our Event List widget and then filter the query args to only get events that have start dates passed the current date.

    For this, you would use the “tribe_events_list_widget_query_args” filter. That filter works to modify the arguments that will be passed to our “tribe_get_events” function. For that you could do something like:

    
    add_filter( 'tribe_events_list_widget_query_args', 'custom_widget_filter' );
    function custom_widget_filter( $args ) {
    $args['start_date'] = current_time( 'Y-m-d' );
    }
    

    Let me know if this helps.

    Thanks!

    #1224382
    Daniel
    Participant

    I’m sorry, please explain how to use such widget and how to modify it. Is it a kind of shortcode to use in a post or do I have to put the code in the functions.php?

    Thanks for your reply

    Daniel

    #1225358
    Josh
    Participant

    Hey Daniel,

    Thanks for following up.

    Our plugin comes with the Event List widget so you can add that to the widget area that you were wanting to use it in.

    After that, you would use the code to filter the query for the widget by adding it to your theme’s functions.php file or you could use a code snippet type of plugin.

    Let me know if this helps.

    Thanks!

    #1226041
    Daniel
    Participant

    Dear Josh,

    thanks! Something changed in the view, but not what I wanted. Take a look at the screenshot. I use the widget on my frontpage and I set the mount of events to 3. But it shows me 10 events with a start date August 2016. Take a look here http://www.bildungswerk.de .

    Daniel

    #1226947
    Josh
    Participant

    Hey Daniel,

    It looks like I forgot to add the last line in that function where you return the $args:

    
    add_filter( 'tribe_events_list_widget_query_args', 'custom_widget_filter' );
    function custom_widget_filter( $args ) {
    $args['start_date'] = current_time( 'Y-m-d' );
    return $args;
    }
    

    That should address half the issue, however it looks like that argument for “start_date” doesn’t actually use that as an “events that start after this date” type of filter. Will need to think of an alternative approach which might be a manual check on the start date from the results. I’ll have to do a little playing around with this and get back to you.

    Thanks!

    #1229805
    Daniel
    Participant

    Hey Josh,

    I’m sorry, there’s no more error anymore but it seems to do nothing. If I delete the code from the function.php it’s the same result.

    Daniel

    #1232193
    George
    Participant

    Hey Daniel,

    Thanks for your patience here. We’re still tinkering with a code snippet here for you but will have one coming soon! Stay tuned 😀

    — George

    #1238825
    George
    Participant

    Hey Daniel,

    I’m sorry to bear this news, but this customization was much harder to pull off than expected and we have not been successful in creating it. 🙁

    I won’t be able to come up with a solution here like we tried.

    I am sorry to disappoint! Please let me know if there are any other issues or questions I can try to help with.

    Sincerely,
    George

    #1252395
    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 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Upcoming’ is closed to new replies.