[Plugin: Yet Another Related Posts Plugin 3.4.2] Adding thumbnail to widget
-
Hey all, I’m trying to tweak the sidebar widget for the Yet Another Related Posts Plugin a bit. What I’d like to do is:
1) Display a thumbnail only for the first post that is listed, and;
2) Add author and post date below the titles.
Here’s what I tried to do with the template-widget.php. It adds the thumbnails all right but it lists them all on top of one another, above the titles and links.
<?php if (have_posts()) { $output .= '<ul>'; while (have_posts()) { the_post(); $output .= '<a href="'.get_permalink().'" rel="bookmark">'.the_post_thumbnail( 'node-based-thumb', get_the_ID() ).'</a>'; $output .= '<li><a href="'.get_permalink().'" rel="bookmark">'.get_the_title().'</a>'; // $output .= ' ('.round(get_the_score(),3).')'; $output .= '</li>'; } $output .= '</ul>'; } else { $output .= '<p><em>'.__('No related posts.','yarpp').'</em></p>'; }
That’s no good. Can someone help?
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘[Plugin: Yet Another Related Posts Plugin 3.4.2] Adding thumbnail to widget’ is closed to new replies.