diff --git a/functions.php b/functions.php index 331977a..4483030 100644 --- a/functions.php +++ b/functions.php @@ -71,6 +71,28 @@ function atravelblog_related_posts() { echo(' '); endif; wp_reset_query(); + $touren = new WP_Query( array( + 'category_name' => 'Tour', + 'posts_per_page' => -1, + 'meta_query' => array( + array( + 'key' => 'urlaub', // name of custom field + 'value' => get_the_ID(), // matches exaclty "123", not just 123. This prevents a match for "1234" + 'compare' => '=' + ) + ) + ) ); + if ($touren->have_posts()) : + echo('

Touren:

'); + echo(' '); + endif; + wp_reset_query(); } elseif($cat == 'Tour') { $urlaub = new WP_Query(array('p' => get_field('urlaub')[0])); if ($urlaub->have_posts()) :