Guest User

Untitled

a guest
Mar 19th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. <?php get_header(); ?>
  2.  
  3. <div id="content">
  4.  
  5. <?php get_template_part('includes/breadcrumbs'); ?>
  6.  
  7. <div class="archive-child">
  8. <?php
  9. $x = get_category( get_query_var( 'cat' ) );
  10. $y = $x->cat_ID;
  11. //echo $y;
  12.  
  13. ?>
  14. <?php
  15. $parent_cat_arg = array('hide_empty' => false, 'parent' => 0 );
  16. $parent_cat = get_terms('category',$parent_cat_arg);//category name
  17. $child_arg = array( 'hide_empty' => false, 'parent' => $y );
  18. $child_cat = get_terms( 'category', $child_arg );
  19. echo '<ul class="child-ul">';
  20. foreach( $child_cat as $child_term ) {
  21. echo '<li class="ar-child-cat"><a href="'.get_term_link($child_term).'">'. $child_term->name . '</a></li>';
  22. }
  23. echo '</ul>';
  24. ?>
  25. </div>
  26. <?php
  27. $arg = array(
  28. 'order' => 'ASC',
  29. 'cat' => $y,
  30. 'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1)
  31. );
  32. $the_query = new WP_Query($arg);
  33. ?>
  34. <?php if ( $the_query->have_posts()) : while ( $the_query-> have_posts() ) : $the_query->the_post() ?>
  35.  
  36.  
  37. <?php get_template_part('includes/loop'); ?>
  38.  
  39. <?php endwhile; ?>
  40.  
  41. <div class="clear"></div>
  42.  
  43. <?php if (function_exists('wp_pagenavi')) wp_pagenavi(); else { ?>
  44.  
  45. <div class="pagination">
  46. <div class="left"><?php previous_posts_link(__('Newer Entries', 'themejunkie')) ?></div>
  47. <div class="right"><?php next_posts_link(__('Older Entries', 'themejunkie')) ?></div>
  48. <div class="clear"></div>
  49. </div> <!-- .pagination -->
  50.  
  51. <?php } ?>
  52.  
  53. <?php else : ?>
  54.  
  55. <?php endif; ?>
  56.  
  57. </div> <!-- #content -->
  58.  
  59. <?php get_sidebar(); ?>
  60. <?php get_footer(); ?>
Add Comment
Please, Sign In to add comment