Posted By

Wiederkehr on 04/15/09


Tagged

wordpress tags posts


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

atma


Related Posts


 / Published in: PHP
 

  1. <?php
  2. $tags = wp_get_post_tags($post->ID);
  3. if ($tags) {
  4. echo 'Related Posts';
  5. $first_tag = $tags[0]->term_id;
  6. $args=array(
  7. 'tag__in' => array($first_tag),
  8. 'post__not_in' => array($post->ID),
  9. 'showposts'=>5,
  10. 'caller_get_posts'=>1
  11. );
  12. $my_query = new WP_Query($args);
  13. if( $my_query->have_posts() ) { ?>
  14. <ul>
  15.  
  16. </ul>

Report this snippet  

You need to login to post a comment.