alchymyth

cat loop core

Nov 19th, 2011
879
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.75 KB | None | 0 0
  1. <div class="panel" id="cat-item-<?php echo $cat->term_id; ?>">
  2.             <?php query_posts('category_name='.$cat->slug.'&posts_per_page='); ?>
  3.                if(have_posts()) :
  4.             <h1 class="page-title"><?php $catid = $cat->term_id; $cat_family = array_reverse(explode(',',get_category_parents($catid,false,','))); echo ($cat_family[2]) ? $cat_family[2].' ' : '';?><br />
  5.                     <span class="bigga">
  6.                         <?php echo $cat->name; ?>
  7.                     </span></h1>
  8.                
  9.             <?php while (have_posts()) : the_post(); ?>
  10.             <?php get_template_part( 'content' ); ?>
  11.             <?php endwhile; // end of the loop. ?>
  12.             <?php endif; ?>
  13.        <?php wp_reset_query(); ?>
  14.          </div>
  15.  
Advertisement
Add Comment
Please, Sign In to add comment