Advertisement
alchymyth

Untitled

Apr 6th, 2011
349
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.18 KB | None | 0 0
  1. <?php
  2. $cat = get_query_var('cat');
  3.  
  4. if(!get_category($cat)->category_parent) : //check if this is top-category
  5.  
  6. $categories=get_categories('child_of='.$cat);
  7. if ($categories) {
  8.  foreach($categories as $term) {
  9.  
  10.    echo '<h1><a href="' . get_category_link( $term->term_id ) . '" title="' . sprintf( __( "View %s" ), $term->title ) . '" ' . '>' . $term->name.'</a></h1>';
  11.    echo '' . $term->description.'<br><br>';
  12.  }
  13. }
  14. ?>
  15.  
  16. <?php $args = array(
  17. 'category__in' => $this_cat,
  18. 'paged' => get_query_var('paged')
  19. ); //prepare to show only direct post of this category
  20. query_posts( $args ); ?>
  21.  
  22. <? endif; // end of check ?>
  23.  
  24. <ol>
  25. <?php while (have_posts()) : the_post(); ?>
  26. <li><h3><a href="<?php the_permalink(); ?>">
  27. <?php the_title(); ?></a></h3>
  28. <div style="float:left; margin-bottom:10px;  padding-right:5px;" id="thumb">
  29. <?php the_post_thumbnail('thumbnail'); ?>
  30. </div>
  31. <div id="postdescrip" style="margin-bottom:50px; ">
  32.     <?php the_excerpt(); ?>
  33.     </div>
  34.     </li>
  35. <?php endwhile; ?>
  36. </ol>
  37. <div class="navigation">
  38.   <div class="alignleft"><?php previous_posts_link('&laquo; Previous') ?></div>
  39.   <div class="alignright"><?php next_posts_link('More &raquo;') ?></div>
  40. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement