upcoming events – newest events

Home Forums Calendar Products Events Calendar PRO upcoming events – newest events

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1226067
    Stefan
    Participant

    Hello,

    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

    #1226654
    George
    Participant

    Hey 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! 😀
    George

    #1226664
    Stefan
    Participant

    Hey 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 —-

    #1226821
    George
    Participant

    Sure 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

    #1227401
    Stefan
    Participant

    Hi,

    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

    #1227880
    George
    Participant

    Hey 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

    #1228876
    Stefan
    Participant

    Hi,

    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

    • This reply was modified 9 years, 2 months ago by Stefan.
    • This reply was modified 9 years, 2 months ago by Stefan.
    #1230029
    George
    Participant

    Hey 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

    #1230243
    Stefan
    Participant

    I 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

    #1230952
    George
    Participant

    Okay 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

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘upcoming events – newest events’ is closed to new replies.