Guest User

Untitled

a guest
Nov 20th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. <?php
  2. /**
  3. * Template Name: Custom Category Archive
  4. *
  5. *
  6. */
  7. <?php $categories = get_categories( $args );?>
  8. <?php foreach ($categories as $category) { $catCounter++; $catLink=get_category_link($category->term_id);
  9. $catStyle = '';
  10. if (is_int($catCounter / 2)) $catStyle = ' class="catAlt"';
  11. echo '<h3 class="archive-category"><a href="'.$catLink.'" title="'.$category->name.'">'.ucwords($category->name).'</a></h3>';
  12. query_posts('cat='.$category->term_id.'&posts_per_page=-1');?>
  13. <ul class="archive-post-list">
  14. <?php while (have_posts()) : the_post(); ?>
  15. <li><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></li>
  16. <?php endwhile; ?>
  17. </ul>
  18. <?php } ?>
Add Comment
Please, Sign In to add comment