Posts Tagged ‘ WordPress Related Posts ’
WordPress Related Posts without using a Plugin
Wednesday, February 3rd, 2010Related posts is one of the most used functions in WordPress. Even though there are some great plugins to achieve this, the best way is to use a function of your own to display the related posts. To do that, simply copy and paste the following code where you wish to show the related posts. This code gets related posts based on the posts’ tag(s).
<?php…
//for use in the loop, list 5 post titles related to first tag on current post
$tags = wp_get_post_tags($post->ID);
if ($tags) {
echo 'Related