Add person filter
This commit is contained in:
parent
c9b9542137
commit
fe09bbb472
1 changed files with 7 additions and 0 deletions
|
|
@ -24,6 +24,13 @@ add_filter('acf/fields/google_map/api', 'my_acf_google_map_api');
|
||||||
function my_home_category( $query ) {
|
function my_home_category( $query ) {
|
||||||
if ( $query->is_home() && $query->is_main_query() ) {
|
if ( $query->is_home() && $query->is_main_query() ) {
|
||||||
$query->set( 'cat', '2');
|
$query->set( 'cat', '2');
|
||||||
|
if ( !empty( $_GET['person'] ) ) {
|
||||||
|
$query->set( 'meta_query', array(
|
||||||
|
'key' => 'mitreisende',
|
||||||
|
'value' => '"' . $_GET['person'] . '"',
|
||||||
|
'compare' => 'LIKE'
|
||||||
|
) );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue