$orig_post = $post;
global $post;
$tags = wp_get_post_tags($post->ID);
   
if ($tags) {
  $tag_ids = array();
  foreach($tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;
  $args=array(
  'tag__in' => $tag_ids,
  'post__not_in' => array($post->ID),
  'posts_per_page'=>4,
  );
$query = new WP_Query($args);
while ($query->have_posts()){
$query->the_post(); 
// ...输出内容
}
}
?>