• Resolved lucianacristea

    (@lucianacristea)


    Hi all,

    I am using the shortcode to sort the events based on the event start date. This was working fine until the upgrade to 2.5. All events created after 2.5 seem not to be sorted anymore correctly, they are added always to the end of the list even if they should be displayed on top or in between.

    Can you please check?

    Thanks.

Viewing 12 replies - 1 through 12 (of 12 total)
  • Hi @lucianacristea,

    Thank you for providing me with all the details. Can you please update to 2.6 let me know if your time and date problem fixed?

    If not then you can write again we will be glad to assist you ??

    Thank you

    Thread Starter lucianacristea

    (@lucianacristea)

    Hi @hiteshmakvana,

    Not sure what you mean with the issue about time and date.The one reported 2 days ago with the time has been resolved (I have responded in the corresponding topic) however another related issue has been identified – this has been described within a separate email.

    The issue here is with the sorting. This issue is not solved with upgrade to 2.6. I have remarked that appeared after 2.5 upgrade but I did not have time to report it before you provided the 2.6 upgrade. However, tests has been done under 2.6.

    So the sorting issue is still there after the upgrade to 2.6. You can have a look, I have provided credentials as part of the other issue I reported.

    Thanks a lot for your support.

    Hi @lucianacristea,
    We are working on your both issue soon we will update the plugin with both bug.

    Sorry for the inconvenience.

    Thank you

    Hi @lucianacristea,

    We have fixed all the bug in 2.7 and now you can update. Thank you so much for providing your feedback ??

    Thank you.

    Thread Starter lucianacristea

    (@lucianacristea)

    Hi @hiteshmakvana,

    I have upgraded to 2.7 but the sorting is not fully solved. Events created with 2.5 are not being sorted. Look in the staging site to check this (last event in the list). I have saved one more time the settings after the upgrade to 2.7, as well as the event but with no effect.

    In addition, I noted that in admin in Setting – > Sent Events (3rd tab) I cannot find anymore the field for date setting. Only time setting is displayed. Where can I change the date format?

    I will appreciate if you check this case as well.

    Thanks.

    Hi @lucianacristea,

    Sorry for the inconvenience we have added date format in 2.5 but that was conflicting with sorting. If you udpate your event date with 2.7 version it will fix your issue.

    We have removed date format in 2.7 it was not functioning as we expected.

    I hope you understand.
    Thank you

    Thread Starter lucianacristea

    (@lucianacristea)

    Hi,

    Thanks for the clarifications with the dare field. However, as mentioned sorting is still not working. Please check my events. The event listed on the last page does not belong there, it should be shown on the first page. Newly created events are getting sorted correctly but this one was created with 2.5. and seems to not be recognized somehow.

    Regards.

    Hi @lucianacristea,

    If you have created events in 2.5 please update those events date. It is the issue of date format which is conflicting in sorting.

    I hope it will solve your issue. Let us know if you have any issue.

    Thank you

    Hello, same issue here.

    I have created 2 events with the 2.7 version, the event sorting by date does not work.

    https://golondonadventures.co.uk/day-hikes/

    This is the shortcode utilised:

    [events]

    If I want to sort the events from the earliest to the latest one:

    [events order=”ASC”]

    the events are still ordered from the latest to the earliest one

    This is the current situation:

    Sep 30
    Sep 26
    Sep 24

    This is what I would expect:

    Sep 24
    Sep 26
    Sep 30

    • This reply was modified 6 years, 5 months ago by lpenn.
    • This reply was modified 6 years, 5 months ago by lpenn.
    • This reply was modified 6 years, 5 months ago by lpenn.

    Hi @lpenn,

    If you are using order clause without order by then it is taking default orderby event posted date. You can add your orderby clause value from the below documentation https://www.wp-eventmanager.com/documentation/the-event-listings/

    There is limitation in orderby meta key in wordpress so some time it works some time it doesn’t. Event start date is meta key so you can apply custom code or apply from the documentation.

    I hope it helps.

    Thank you.

    Thread Starter lucianacristea

    (@lucianacristea)

    Hi @hiteshmakvana,

    I have followed my instructions and problem is now solved.

    Thanks a lot for your support.

    Ok, I have updated the shortcode like this and it works!

    [events show_filters="false" orderby="_event_start_date" order="ASC"]

    functions.php:

    //ORDER BY DATE
    /** You need to put code in theme functions.php **/
    function theme_name_custom_orderby( $query_args ) {
    	$query_args[ 'orderby' ] = 'meta_value'; //orderby will be according to data stored inside the particular meta key
    	$query_args[ 'order' ] = 'DESC';
    	return $query_args;
    }
     
    add_filter( 'event_manager_get_listings_args', 'theme_name_custom_orderby', 99 );
     
    function theme_name_custom_orderby_query_args( $query_args ) {
    	$query_args[ 'meta_key' ] = '_event_start_date'; //here you can change your meta key
    	return $query_args;
    }
     
    add_filter( 'get_event_listings_query_args', 'theme_name_custom_orderby_query_args', 99 );

    @hitesh, I suggest to add this to the basic order_by functionality without having to change functions.php, this is an important feature for us ??

    • This reply was modified 6 years, 5 months ago by lpenn.
    • This reply was modified 6 years, 5 months ago by lpenn.
Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Events are not sorted anymore correctly after upgrade to 2.5 / 2.6’ is closed to new replies.