Add header to style
This commit is contained in:
parent
4e0a3220cc
commit
76e513bc89
1 changed files with 9 additions and 5 deletions
|
|
@ -23,31 +23,35 @@ add_filter('acf/fields/google_map/api', 'my_acf_google_map_api');
|
||||||
|
|
||||||
// Related posts function
|
// Related posts function
|
||||||
function atravelblog_related_posts() {
|
function atravelblog_related_posts() {
|
||||||
echo('<div class="related-posts posts section-inner">');
|
|
||||||
global $post;
|
global $post;
|
||||||
$thisID = get_the_ID();
|
$thisID = get_the_ID();
|
||||||
$cat = get_the_category()[0]->name;
|
$cat = get_the_category()[0]->name;
|
||||||
if ( $cat == 'Urlaub' ){
|
if ( $cat == 'Urlaub' ){
|
||||||
$tagebuch = new WP_Query( array( 'category_name' => 'Tagebuch' ) );
|
$tagebuch = new WP_Query( array( 'category_name' => 'Tagebuch' ) );
|
||||||
if ($tagebuch->have_posts()) :
|
if ($tagebuch->have_posts()) :
|
||||||
echo('<h4>Tagebuch Einträge:</h4>');
|
echo('<div class="related-posts posts section-inner">');
|
||||||
|
echo('<h4 style="color: white; margin-top: 20px;">Tagebuch Einträge:</h4>');
|
||||||
while ( $tagebuch->have_posts() ) : $tagebuch->the_post();
|
while ( $tagebuch->have_posts() ) : $tagebuch->the_post();
|
||||||
global $post;
|
global $post;
|
||||||
if($thisID == get_field('urlaub')->ID){
|
if($thisID == get_field('urlaub')->ID){
|
||||||
get_template_part( 'content', get_post_format() );
|
get_template_part( 'content', get_post_format() );
|
||||||
}
|
}
|
||||||
endwhile;
|
endwhile;
|
||||||
|
echo('<div class="clear"></div>');
|
||||||
|
echo('</div> <!-- /related-posts -->');
|
||||||
endif;
|
endif;
|
||||||
|
wp_reset_query();
|
||||||
} elseif($cat == 'Tour') {
|
} elseif($cat == 'Tour') {
|
||||||
$urlaub = new WP_Query(array('p' => get_field('urlaub')[0]));
|
$urlaub = new WP_Query(array('p' => get_field('urlaub')[0]));
|
||||||
if ($urlaub->have_posts()) :
|
if ($urlaub->have_posts()) :
|
||||||
|
echo('<div class="related-posts posts section-inner">');
|
||||||
while ( $urlaub->have_posts() ) : $urlaub->the_post();
|
while ( $urlaub->have_posts() ) : $urlaub->the_post();
|
||||||
global $post;
|
global $post;
|
||||||
get_template_part( 'content', get_post_format() );
|
get_template_part( 'content', get_post_format() );
|
||||||
endwhile;
|
endwhile;
|
||||||
|
echo('<div class="clear"></div>');
|
||||||
|
echo('</div> <!-- /related-posts -->');
|
||||||
endif;
|
endif;
|
||||||
|
wp_reset_query();
|
||||||
}
|
}
|
||||||
echo('<div class="clear"></div>');
|
|
||||||
echo('</div> <!-- /related-posts -->');
|
|
||||||
wp_reset_query();
|
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue