I am using Elementor Pro and Advanced Queries and also ACF for custom date. I have 2 types of posts that are events - event 1 and event 2. I have an event calendar on the first page showcasing the upcoming event by date (ASC) using custom php and Advanced Querie = works perfectly. BUT as one of the event types are more expensive (better for business) I need it to be shown by dated first. To sum it up I need the events to be showcased like this:
Event 1 (by ASC):
- August 1
- August 2
- Aust 3
Follong in the same post list (by ASC):
Event 2:
- August 2
- August 4
- August 8
I also wantto state that I mostly work with Elementor Pro only and no PHP, I have o experiance in that so I am just searching on internet for codes to help solve my problem.
This is the code I used and that worked to list it by date using ACF and Advanced Querie ID:
add_action( 'elementor/query/my_custom_filter', function( $query ) {
$query->set( 'meta_key', 'datums' );
$query->set( 'orderby', 'meta_value_num' );
$query->set( 'order', 'ASC' );
});
Then I found something that would match on internet like this:
add_action( 'elementor/query/my_custom_filter', function( $query ) {
$query->set( 'meta_key', 'datums' );
$query->set( 'orderby', 'meta_value_num' );
$tax_query = array(
array(
'taxonomy' => 'category',
'field' => 'slug',
'terms' => 'retriti'
),
array(
'taxonomy' => 'category',
'field' => 'slug',
'terms' => 'visas-meditacijas'
),
);
$query->set( 'tax_query', $tax_query );
$query->set( 'order', 'ASC' );
});
But then the events disapeared at all..
I have find diferen codes online for this as well but thet do not seem to work for my custom filter by date anymore.. Please help me - I am lost and want to cry :D