Thanks for you response!
I hope that in your work there was a similar experience of the task.
Tell me, please, a ready-made solution that takes a value from the repeater fields that users fill out and sends / outputs them?
@hube2 Thanks!
Now it’s working, but how I can add option – “All Years” and show all posts when it’ll selected?
@hube2 Thank you!
It’s done.
I used this ‘pre_get_posts’ function –
add_action( 'pre_get_posts', 'my_pre_get_posts' );
function my_pre_get_posts( $query ) {
if ( is_admin() ) {
return $query;
}
if ( isset($query->query_vars['post_type']) && $query->query_vars['post_type'] == 'post' ) {
if( isset($_GET['press']) ) {
$query->set('meta_key', 'press');
$query->set('meta_value', $_GET['press']);
}
}
return $query;
}