Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php $terms = get_terms(['hide_empty' => true, 'taxonomy' => 'NOME_DA_TAXONOMIA']); ?>
- <?php foreach ($terms as $term) : ?>
- <?php
- $posts = get_posts([
- 'post_type' => 'NOME_DO_POST_TYPE',
- 'tax_query' => [
- [
- 'taxonomy' => 'NOME_DA_TAXONOMIA',
- 'terms' => $term->term_id,
- ],
- ],
- ]);
- ?>
- <div>
- Titulo da categoria: {{ $term->name }}
- <div class="carousel">
- <?php foreach ($posts as $post) : the_post($post); ?>
- Titulo do post: {{ get_the_title() }}
- <?php endforeach; ?>
- </div>
- </div>
- <?php endforeach; ?>
Add Comment
Please, Sign In to add comment