0

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;
?>

1 Answer 1

0

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;
 ?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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