From 189bf114a2af45903a49846f8e1e81ed897c7026 Mon Sep 17 00:00:00 2001 From: Markus Ankenbrand Date: Sat, 10 Sep 2016 20:57:48 +0200 Subject: [PATCH] Fix query for Tagebuch entries --- single.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/single.php b/single.php index d29aa52..2cd1ce7 100644 --- a/single.php +++ b/single.php @@ -91,11 +91,13 @@ 'Tagebuch', - 'meta_key' => 'urlaub', // name of custom field - 'meta_value' => '"' . get_the_ID() . '"', // matches exaclty "123", not just 123. This prevents a match for "1234" + 'category_name' => 'Tagebuch' )); - var_dump($tagebuch); + foreach($tagebuch as $tb){ + if(get_field('urlaub',$tb->ID)->ID === get_the_ID()){ + get_template_part( 'content', get_post_format($tb->ID) ); + } + } ?>