diff --git a/functions.php b/functions.php
index 37428dd..cfe4451 100644
--- a/functions.php
+++ b/functions.php
@@ -23,31 +23,35 @@ add_filter('acf/fields/google_map/api', 'my_acf_google_map_api');
// Related posts function
function atravelblog_related_posts() {
- echo('
');
global $post;
$thisID = get_the_ID();
$cat = get_the_category()[0]->name;
if ( $cat == 'Urlaub' ){
$tagebuch = new WP_Query( array( 'category_name' => 'Tagebuch' ) );
if ($tagebuch->have_posts()) :
- echo('
Tagebuch Einträge:
');
+ echo('
');
+ echo('
Tagebuch Einträge:
');
while ( $tagebuch->have_posts() ) : $tagebuch->the_post();
global $post;
if($thisID == get_field('urlaub')->ID){
get_template_part( 'content', get_post_format() );
}
endwhile;
+ echo('
');
+ echo('
');
endif;
+ wp_reset_query();
} elseif($cat == 'Tour') {
$urlaub = new WP_Query(array('p' => get_field('urlaub')[0]));
if ($urlaub->have_posts()) :
+ echo('
');
while ( $urlaub->have_posts() ) : $urlaub->the_post();
global $post;
get_template_part( 'content', get_post_format() );
endwhile;
+ echo('
');
+ echo('
');
endif;
+ wp_reset_query();
}
- echo('
');
- echo('
');
- wp_reset_query();
}
\ No newline at end of file