Advertisement
Guest User

Untitled

a guest
Sep 12th, 2011
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. <?php
  2. $categories = get_the_category($post->ID);
  3. if ($categories) {
  4. $category_ids = array();
  5. foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id;
  6. $args=array(
  7. 'category__in' => $category_ids,
  8. 'post__not_in' => array($post->ID),
  9. 'showposts'=>4,
  10. 'caller_get_posts'=>1
  11. );
  12. $my_query = new WP_Query($args);
  13. if( $my_query->have_posts() ) {
  14. while ($my_query->have_posts()) : $my_query->the_post();
  15. WHERES THIS PART?
  16. endwhile;
  17. }
  18. else {
  19. echo 'No Related Posts';
  20. }
  21. }
  22. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement