From fe09bbb472c9d939550d592b8199aada0d2f0cdd Mon Sep 17 00:00:00 2001 From: Markus Ankenbrand Date: Mon, 12 Sep 2016 20:01:49 +0200 Subject: [PATCH] Add person filter --- functions.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/functions.php b/functions.php index 6ad43ce..a2c1997 100644 --- a/functions.php +++ b/functions.php @@ -24,6 +24,13 @@ add_filter('acf/fields/google_map/api', 'my_acf_google_map_api'); function my_home_category( $query ) { if ( $query->is_home() && $query->is_main_query() ) { $query->set( 'cat', '2'); + if ( !empty( $_GET['person'] ) ) { + $query->set( 'meta_query', array( + 'key' => 'mitreisende', + 'value' => '"' . $_GET['person'] . '"', + 'compare' => 'LIKE' + ) ); + } } }