Created
April 21, 2020 10:25
-
-
Save robindevitt/be6d5fe08c69145506bf08e0e098cdd9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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