diff --git a/functions.php b/functions.php index cadbf37..6ad43ce 100644 --- a/functions.php +++ b/functions.php @@ -20,6 +20,14 @@ function my_acf_google_map_api( $api ){ add_filter('acf/fields/google_map/api', 'my_acf_google_map_api'); +// Only show posts of category Urlaub (id=2) +function my_home_category( $query ) { + if ( $query->is_home() && $query->is_main_query() ) { + $query->set( 'cat', '2'); + } +} + +add_action( 'pre_get_posts', 'my_home_category' ); // Related posts function function atravelblog_related_posts() {