Home › Forums › Calendar Products › Events Calendar PRO › upcoming events – newest events
- This topic has 10 replies, 3 voices, and was last updated 9 years, 2 months ago by
Stefan.
-
AuthorPosts
-
January 30, 2017 at 3:23 am #1226067
Stefan
ParticipantHello,
I would like to show the recently added events and not the upcoming events in different list views.
I have a event calender Pro licence
if found the getEvents() function.
Any hint
January 30, 2017 at 9:56 pm #1226654George
ParticipantHey Stefan,
Sorry to disappoint, but it’s unfortunately quite tricky to show events this way. It may require custom coding based on your specific goal—we’re not able to help with custom coding as described here, but it may not be necessary here anyways.
Can you clarify how you want to show this list of events? Are you trying to just use a shortcode to list some events in this way, for example? Or a widget, for example? Or are you saying the main List View itself?
This will help me provide some insight in how you can achieve this.
Thanks! 😀
GeorgeJanuary 30, 2017 at 10:31 pm #1226664Stefan
ParticipantHey George,
I just want to have a list that is ordert by publish date.
A hint were I have to make the change for ORDER BY would help.—- The Events Calendar schrieb —-
January 31, 2017 at 8:07 am #1226821George
ParticipantSure thing Stefan. To help me help you with exactly where to make that change, can you clarify if y are you trying to just use a shortcode to list some events in this way, for example? Or a widget, for example? Or are you saying the main List View itself?
Are you hoping to make all instances of the [tribe_events_list] shortcode work like you describe? Or do you want your site’s main /events/ page to be ordered like you describe?
— George
February 1, 2017 at 1:53 am #1227401Stefan
ParticipantHi,
good would be the possibility by shortcode or
better like in a filter. that the user can desside for each view.
And a widget with a list of newes events would also be a good idea
February 1, 2017 at 4:18 pm #1227880George
ParticipantHey Stefan,
Thanks for your feedback.
We cannot help with custom coding, so I won’t be able to tinker with each of the things you mention and you will have to mostly take the reins on this yourself in terms of implementing it on your site and maintaining the custom code over time (please keep backups of the custom code I share so you don’t lose it!).
But here is what I’ve been able to come up with—this will make any instance of the [tribe_events_list] shortcode and of the List Widget show events by the date they were published, not by the time they are happening:
add_filter( 'tribe_events_list_widget_query_args', 'tribe_attempt_to_sort_events_by_publish_date' );
function tribe_attempt_to_sort_events_by_publish_date( $args ) {
if ( ! is_array( $args ) ) {
return $args;
}unset( $args['meta_query'] );
unset( $args['eventDisplay'] );
unset( $args['tribe_render_context'] );$args['orderby'] = 'date';
$args['order'] = 'ASC';
$args['posts_per_page'] = 5;return $args;
}
☝️ Unfortunately this is a tricky customization to do, so this code may need further refinement to get it working just right.
We cannot help with custom coding like this, but I wanted to at least try and get you started here.
Best of luck with these customizations!
Please let me know if there are any other issues or questions I can try to help with.
— George
February 3, 2017 at 6:44 am #1228876Stefan
ParticipantHi,
thats not working.
There is a function that is putting in every query “ORDER BY EventStartDate”:… ORDER BY EventStartDate DESC, sqC54_posts.post_date DESC …
So I made a own widget with a list. Like the List Widget. But my filter arguments where always but after Ordering by EventSTartDate.
Here my Args Array ( [eventDisplay] => list [featured] => [order] => DESC [orderby] => post_date [post_type] => tribe_events [posts_per_page] => 5 [tribe_render_context] => widget )
Where can I find this … function where you change the query.
Stefan
February 6, 2017 at 9:41 am #1230029George
ParticipantHey Stefan,
I’m not quite sure what query you’re referring to. Can you please clarify these two things that you said?
First:
There is a function that is putting in every query “ORDER BY EventStartDate”:
Next:
So I made a own widget with a list.
1. Are you saying that you have made a custom list of events? If so, please copy all of your code and paste the code into Gists at http://gist.github.com, then share links to those Gists here so I can take a look at your code.
2. Can you please confirm that you have read this page and are aware of the fact that we cannot help with any custom coding? → https://theeventscalendar.com/knowledgebase/what-support-is-provided-for-license-holders/
— George
February 6, 2017 at 4:27 pm #1230243Stefan
ParticipantI made a new list and changed some code in the Query.php
$order_sql = “Post_Date {$order}”;
now. I can get my list ordert by post_date.
Can not find any problems so for me in the moment this problem is solved
Thanks
February 7, 2017 at 3:24 pm #1230952George
ParticipantOkay Stefan, thanks for confirming your issue is resolved for now.
Best of luck with your project. Please open a new thread any time if other issues or questions arise.
Sincerely,
George -
AuthorPosts
- The topic ‘upcoming events – newest events’ is closed to new replies.
