Guest User

Untitled

a guest
Dec 11th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. <?php
  2. if ( have_posts() ) : ?>
  3.  
  4. <header class="page-header">
  5. <h1>Subcategories</h1>
  6. </header><!-- .page-header -->
  7. <div class="row">
  8. <div class="col-sm-12">
  9.  
  10. <?php
  11.  
  12. /*
  13. * Include the Post-Format-specific template for the content.
  14. * If you want to override this in a child theme, then include a file
  15. * called content-___.php (where ___ is the Post Format name) and that will be used instead.
  16. */
  17.  
  18. $term = get_queried_object();
  19. $term_id = $term->term_id;
  20. $taxonomy_name = $term->taxonomy;
  21.  
  22. $termchildren = get_term_children( $term_id, $taxonomy_name );
  23.  
  24. echo '<ul>';
  25. foreach ( $termchildren as $child ) {
  26. $term = get_term_by( 'id', $child, $taxonomy_name );
  27. echo '<li><a href="' . get_term_link( $term, $taxonomy_name ) . '">' . $term->name . '</a></li>';
  28. }
  29. echo '</ul>';
  30.  
  31. wp_link_pages( array(
  32. 'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'fernox' ),
  33. 'after' => '</div>',
  34. ) );
  35.  
  36. the_posts_navigation();
  37.  
  38. else :
  39.  
  40. get_template_part( 'template-parts/content', 'none' );
  41.  
  42. endif; ?>
  43.  
  44. </div>
  45. </div>
  46. </div>
Add Comment
Please, Sign In to add comment