diff --git a/functions.php b/functions.php index 99390a6..331977a 100644 --- a/functions.php +++ b/functions.php @@ -49,6 +49,28 @@ function atravelblog_related_posts() { echo(' '); endif; wp_reset_query(); + $album = new WP_Query( array( + 'category_name' => 'Album', + '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 ($album->have_posts()) : + echo('