diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 3c65706..e5f3f42 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,7 +4,6 @@
-
@@ -25,7 +24,7 @@
-
+
@@ -40,8 +39,8 @@
-
-
+
+
@@ -50,11 +49,11 @@
-
+
-
-
+
+
@@ -69,8 +68,8 @@
@@ -305,16 +304,16 @@
1473509435154
-
+
-
+
-
+
@@ -365,25 +364,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -394,5 +374,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/functions.php b/functions.php
index 27dd903..a64a43a 100644
--- a/functions.php
+++ b/functions.php
@@ -20,32 +20,28 @@ function my_acf_google_map_api( $api ){
add_filter('acf/fields/google_map/api', 'my_acf_google_map_api');
+
// Related posts function
function atravelblog_related_posts() {
- echo('
');
- global $post;
- if ( get_the_category()[0]->name == 'Urlaub' ){
- $tagebuch = get_posts(array(
- 'category_name' => 'Tagebuch'
- ));
+ echo('
');
+ global $post;
+ $thisID = get_the_ID();
+ if ( get_the_category()[0]->name == 'Urlaub' ){
+ $tagebuch = new WP_Query( array( 'category_name' => 'Tagebuch' ) );
- if ($tagebuch->have_posts()) :
- while ( $tagebuch->have_posts() ) : $tagebuch->the_post(); ?>
+ if ($tagebuch->have_posts()) :
+ while ( $tagebuch->have_posts() ) : $tagebuch->the_post();
+ global $post;
+ if($thisID == get_field('urlaub')->ID){
+ get_template_part( 'content', get_post_format() );
+ }
+ endwhile;
+ endif;
+ echo('
');
+ echo('
');
+ wp_reset_query();
-
+ }
-
-
-
-
-
-
-
-
-
-