Order posts for Event Manager and display location

I am using a looper provider to show the archive of upcoming events. I tried to order it in the first to come: {{dc:global:date}} and meta key _event_start_date << but the result seems random. Not in the correct date order. Also the ones in the past should not be displayed.

I also want to display the location. All I can figure out is displaying location it, but not the location name itself.

Hello @Westervoort,

Thanks for writing in! Instead of using the Looper Provider Query Builder, use the Looper Provider Query String. Have this argument:

$query_args = array(
    'post_type' => 'event',
    'meta_key' => '_event_start_date',
    'orderby' => 'meta_value',
    'order' => 'ASC',
    'meta_query' => array(
        array(
            'key' => '_event_start_date',
            'value' => {{dc:global:date}},
            'compare' => '>=',
            'type' => 'DATETIME'
        )
    )
);

Running the http_build_query() will give this query string:

post_type=event&meta_key=_event_start_date&orderby=meta_value&order=ASC&meta_query%5B0%5D%5Bkey%5D=_event_start_date&meta_query%5B0%5D%5Bvalue%5D=2024-01-15+14%3A30%3A00&meta_query%5B0%5D%5Bcompare%5D=%3E%3D&meta_query%5B0%5D%5Btype%5D=DATETIME

Thanks Ruenel, when I use the argument it will come with my posts and not the events.

And how to show the location? I only see how to show location id, but not hte name itself.

Hey @Westervoort,

For a complete check, we’ll need access to your WordPress dashboard. Please share these details securely:
– Your site’s URL
– WP Admin login URL
– An admin username and password
– Your confirmation that we can log in and make necessary changes

To know how to create a secure note, please check this out: How The Forum Works

image

Best Regards.