Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- foreach( get_terms( 'types', array( 'hide_empty' => false, 'parent' => 0 ) ) as $parent_term ) {
- // display top level term names + display
- echo '<div class="archive_box"><header><h3>'. $parent_term->name . '</h3></header>';
- foreach( get_terms( 'types', array( 'hide_empty' => true, 'parent' => $parent_term->term_id ) ) as $child_term ) {
- // display name of all Children of the parent term
- echo '<div class="tax_section"><h3 class="tax_name">'. $child_term->name . '</h3>';
- echo '<ul class="archive_content">';
- //Loop goes here!
- // WP_Query custom post type "archives", display 3 latest posts from the current CHILD term
- echo '<li><a href="permalinkhere">POSTNAMEHERE <i class="fa fa-arrow-circle-o-right" aria-hidden="true"></i></a></li>';
- //end loop
- echo'</ul><a href="'. $child_term->slug .'" class="button">More '. $child_term->name .'</a></div>';
- }
- //end archivebox
- echo '</div>';
- } ?>
Advertisement
Add Comment
Please, Sign In to add comment