Advertisement
alchymyth

the wheel -reinvented

Mar 10th, 2011
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.58 KB | None | 0 0
  1. <?php
  2. $this_post_id = $post->ID;
  3. $categs = get_the_category($post->ID);
  4. foreach($categs as $cate) { $post_cats[] = $cate->term_id; }
  5. $args = array(
  6. 'posts_per_page' => -1,
  7. 'category__in' => $post_cats
  8. );
  9. $this_query = new WP_query( $args );
  10. if($this_query->have_posts()) :
  11. while($this_query->have_posts()) :
  12. $this_query->the_post();
  13. ?>
  14. <h3<?php if($post->ID == $this_post_id) echo ' class="active"'; ?>><a href="<?php the_permalink(); ?>" title="link to <?php the_title(); ?>"><?php the_title(); ?></a></h3>
  15. <?php the_excerpt();
  16. endwhile;
  17. endif;
  18. wp_reset_query();
  19. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement