Skip to content

Instantly share code, notes, and snippets.

@robindevitt
Created April 21, 2020 10:25
Show Gist options
  • Save robindevitt/be6d5fe08c69145506bf08e0e098cdd9 to your computer and use it in GitHub Desktop.
Save robindevitt/be6d5fe08c69145506bf08e0e098cdd9 to your computer and use it in GitHub Desktop.
<?php
$terms = get_field( 'blog_category_tax' );
foreach ( $terms as $term ):?>
<div class="termWrapper">
<h1><?php echo get_cat_name( $term );?></h1>
<div class="featured_posts">
<?php
$args = array(
'numberposts' => 3
'category' => $term,
);
$latest_posts = get_posts( $args );
foreach ( $latest_posts as $post ) {
echo $post->title;
echo $post['title'];
}
?>
</div>
</div>
<?php endforeach; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment