Fix query for Tagebuch entries

This commit is contained in:
Markus Ankenbrand 2016-09-10 20:57:48 +02:00
parent 85e4123b27
commit 189bf114a2

View file

@ -91,11 +91,13 @@
<?php
$tagebuch = get_posts(array(
'category_name' => '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) );
}
}
?>
<?php endif; ?>