I would like to ask you for your help. What I'm trying to achieve:
I use an elementor. I created a category page template. You can check this on http://estate.romanjelinek.cz/lifestyle . what I'm trying to do is display posts from the Lifestyle and promotion categories on this page. Promotion has two tags (Paid and Unpaid). I need to display first the posts from the category Promotion with the tag Paid (sorted by publication date) and only then all the others (ie together Lifestyle and Promotion with the tag Unpaid). So this is the logie
Promotion Paid need to be first and no matter the date of publication, you just always have to be ahead of the rest in, if there is no posts in promotion Paid, then only 2)
I tried to use this custom query but doesnt work
// Showing post with meta key filter in Portfolio Widget
add_action( 'elementor/query/my_custom_filter', function( $query ) {
// Get current meta Query
$meta_query = $query->get( 'meta_query' );
// If there is no meta query when this filter runs, it should be initialized as an empty array.
if ( ! $meta_query ) {
$meta_query = [];
}
// Append our meta query
$meta_query[] = [
'key' => #no idea what value there
'value' => [ 'lifestyle', 'promotion' ],
'compare' => 'in',
];
$query->set( 'meta_query', $meta_query );
} );
Can u help me with query please?