Coded example of a WordPress plugin I made. It displays related posts after the content of the post. The relation is based on the category of the current post the user is viewing but does not include the current post. The order is random and currently just hard coded to display 3 posts in list format.