Add person filter

This commit is contained in:
Markus Ankenbrand 2016-09-12 20:01:49 +02:00
parent c9b9542137
commit fe09bbb472

View file

@ -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'
) );
}
}
}