SORT by date of event; not date posted

Hello,

I have this code below and am attempting to get it to SORT by the date of the event and not the date of posting / publish

It is defaulted to ordering by latest post on the module and cannot set a custom order by All help is appreciated and thank you in advance for helping out.

All suggestions and assistance welcomed!

add_filter('epic_module_post_meta_2', function($output, $post, $instance, $items) {
    //print_r([$output, $post, $instance, $items]);
    //die();


    return $output;
}, 10, 4);

function av_fix_the_event_date ($the_time, $d, $post) {

    if ($post->post_type != "eventer") return $the_time;
    //die(print_r(get_post_meta($post->ID));
    $evt_date = get_post_meta($post->ID, 'eventer_event_start_dt', true);
    $dynamic_evt_date = get_post_meta($post->ID, 'eventer_event_multiple_dt_inc', true);
    $evt_date = empty($dynamic_evt_date) ? $evt_date : $dynamic_evt_date;
    return date('F j, Y', strtotime($evt_date));
}

add_filter('get_the_modified_date', 'av_fix_the_event_date', 10, 3);
add_filter('get_the_date', 'av_fix_the_event_date', 10, 4);

What plugin are you using?

Hi, I am using the Eventer and epic news plugins together.

Sponsor our Newsletter | Privacy Policy | Terms of Service