Home › Forums › Calendar Products › Events Calendar PRO › Let events remain in shortcode widget after their past
- This topic has 8 replies, 3 voices, and was last updated 10 years, 1 month ago by
Support Droid.
-
AuthorPosts
-
February 27, 2016 at 12:17 am #1082848
Johan
ParticipantHi there and thanks for a great plugin.
My client wants to have a portfolio of previous exhibitions and thats fine.
Every Exhibition is a single event. On the single event/exhibition page itself I have also planted a shortcode widget to show events that are occurring during the exhibition.Example
Event:
Exhibition by Artist XEvents on the single events page above (short code widget showing certain tag “ArtistX”):
The artist speak monday february 27 @ 4pm
Film screening about the artist february 28 @ 6pmProblem.
The events in the shortcode Widget disappears when past which they really do not want since they see it as an archive of their exhibitions, one should be able to go back to and check what events accorded during that exhibition.
At the moment the event list on the Exhibition show “No events” when past.I really hope you can help me with this.
(Hope I don’t over complicate things here because its pretty basic)February 29, 2016 at 12:03 pm #1083513George
ParticipantHey @Johan,
Thanks for reaching out!
This will require custom coding to achieve; we unfortunately cannot help with custom coding, but I will try to help regardless and might be able to share some useful code here.
To help with that, can you just clarify the exact shortcode you are using? Is it tribe_events_list? If possible, please copy and paste your entire exact shortcode here just so I can be 100% certain in addressing your issues.
Thank you!
GeorgeFebruary 29, 2016 at 12:15 pm #1083517Johan
ParticipantThank you!
Ok, so this is the shortcode that I’m using :[tribe_events_list tags=”My Tag”]
March 2, 2016 at 7:57 am #1084329George
ParticipantThanks for this, @Johan. I’ve done some testing here and found that adding this snippet to your theme’s functions.php file should make a difference and should include those past events:
add_filter( 'tribe_events_list_widget_query_args', 'tribe_include_past_events_in_list' );function tribe_include_past_events_in_list( $args ) {
$args['eventDisplay'] = 'custom';
return $args;
}
Try that out and let me know if it helps!
Thanks,
GeorgeMarch 2, 2016 at 12:41 pm #1084540Johan
ParticipantThanks George! Really appreciate the effort.
I bumped into some trouble though. I didn’t realize that this would reflect on all event lists on the site…
I only need it for the short code widget. Is there a workaround? :/March 2, 2016 at 3:25 pm #1084591George
ParticipantSorry about forgetting that, @Johan! I’d recommend modifying the code to be like this to limit the change to single-events views:
add_filter( 'tribe_events_list_widget_query_args', 'tribe_include_past_events_in_list' );function tribe_include_past_events_in_list( $args ) {
if ( is_single( get_the_ID() ) ) {
$args['eventDisplay'] = 'custom';
}return $args;
}
March 2, 2016 at 9:29 pm #1084690Johan
ParticipantHello again!
I have some more challenges im afraid. On single events pages I also have a list for upcomomg events in the sidebar. And that list should not include past events.It’s in the content of single events page that I have included a shortcode to display events happening during the exhibition and that list I want to stay forever.
Example: Look at this single event and you’ll see the list in the sidebar and the list that says:
Event happening during this exhibition
31 mars, 2016 @ 08:00 – 17:00Is there anyway to exclude the sidebar from the code? That would solve the problem!
Thank you!http://hectornado.se/sv/evenemang/hilma-af-klint/
-
This reply was modified 10 years, 1 month ago by
Johan.
March 3, 2016 at 10:47 am #1084938George
ParticipantHey Johan,
I’m sorry to say it, but that is tricky and there is no good way within WordPress to tell if you’re in a sidebar in a way that I could implement in my code snippet 🙁
I’m sorry about this! You would have to get clever and use some custom, theme-specific coding on your site using functions like the ones described here → https://codex.wordpress.org/Function_Reference/is_active_sidebar
I’m sorry Johan! To implement the extra features you describe, you would have to write that custom code or hire a professional developer to write the code for you. We have a list of great developers here → http://m.tri.be/18k1 (and have no affiliation with any of these folks–they’re simply some well-respected names in the community that we’ve compiled to share in situations like this one).
Sincerely,
GeorgeMarch 18, 2016 at 9:35 am #1091036Support Droid
KeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
This reply was modified 10 years, 1 month ago by
-
AuthorPosts
- The topic ‘Let events remain in shortcode widget after their past’ is closed to new replies.
