Change related blog section

This commit is contained in:
Markus Ankenbrand 2016-09-11 16:28:51 +02:00
parent cb567117fe
commit b27fecc534
3 changed files with 203 additions and 50 deletions

View file

@ -19,3 +19,33 @@ 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('<div class="related-posts posts section-inner">');
global $post;
if ( get_the_category()[0]->name == 'Urlaub' ){
$tagebuch = get_posts(array(
'category_name' => 'Tagebuch'
));
if ($tagebuch->have_posts()) :
while ( $tagebuch->have_posts() ) : $tagebuch->the_post(); ?>
<?php global $post; ?>
<?php get_template_part( 'content', get_post_format() ); ?>
<?php endwhile; ?>
<?php endif; ?>
<div class="clear"></div>
<?php wp_reset_query(); ?>
</div> <!-- /related-posts --> <?php
}
}