Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm using the Wordpress related plugin which is great but I would like to display the feature picture of the page.

It mentions on http://wordpress.org/extend/plugins/related/installation/ about using a custom code.

Below is what I have so fave but I'm looking to add the feature image thumbnail to the related post.

<?php
    $rel = $related->show(get_the_ID(), true);
    foreach ($rel as $r) :
        echo '<li><a href=' . get_permalink($r->ID). '>' . $r->post_title . '</a>' . '</li>';
    endforeach;
?>
share|improve this question

1 Answer 1

up vote 0 down vote accepted

Have worked it out and have the following code:

<?php $rel = $related->show(get_the_ID(), true);
foreach ($rel as $r) :
echo '<a href='.get_permalink($r->ID).'>'.get_the_post_thumbnail($r->ID, array(50,50)).'<div class=page-related-title>'.$r->post_title.'</div>'.'</a>'.'<br />';
endforeach;
 ?>
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.