Replies: 0
<div id=”related_post”>
<?php
$related = get_posts(
array(
‘category__in’ => wp_get_post_categories( $post->ID ),
‘numberposts’ => 5,
‘post__not_in’ => array( $post->ID )
)
);
if( $related ) {
foreach( $related as $post ) {
setup_postdata($post);
?>
<h3><?php the_title();?></h3>
<?php the_post_thumbnail( ‘thumbnail’);?>
<?php the_excerpt( ); ?>
<?php
}
wp_reset_postdata();
}
?>
</div>
<
}
wp_reset_postdata();
}
</div>