How can I have your Post Voting "Most Popular Widget" display Thumbnail Images Left Aligne

I am using your Post Voting Plugin, and it works great. I am using the widget that comes with it "Post Voting Popular Widget" i believe its called and that also works great. But I really would like to add the post thumbnail to the listed posts in the widget, can you help me figure out where to place that code in the widget's file?

Nothing fancy, just want the post thumbnail to be displayed with the posts, I really just need to know where abouts to put the code. Any guidance would be great. Thanks.

  • Vaughan

    hiya

    thanks for posting.

    you would edit

    plugins/wpmu-dev-post-votes/lib/class_wpdv_widget_popular.php

    find

    if (is_array($posts)) {
    			echo "<ul class='wdpv_popular_posts'>";
    			foreach ($posts as $post) {
    				echo "<li>";
    				echo '<a href="' . get_permalink($post['ID']) . '">' . $post['post_title'] . '</a> ';
    				printf(__('<span class="wdpv_vote_count">(%s votes)</span>', 'wdpv'), $post['total']);
    				echo "</li>";
    			}
    			echo "</ul>";
    		}

    then i think just add get_the_post_thumbnail() to the above

    if (is_array($posts)) {
    			echo "<ul class='wdpv_popular_posts'>";
    			foreach ($posts as $post) {
    				echo "<li>";
                                    echo get_the_post_thumbnail( $post['ID'], 32);
    				echo '<a href="' . get_permalink($post['ID']) . '">' . $post['post_title'] . '</a> ';
    				printf(__('<span class="wdpv_vote_count">(%s votes)</span>', 'wdpv'), $post['total']);
    				echo "</li>";
    			}
    			echo "</ul>";
    		}

    you might need some styling adding though.

    hope this helps.

    thanks

  • servicehunter1

    That helped a lot! thank you..

    I used " echo get_the_post_thumbnail($post['ID'], 'thumbnail', array('class' => 'alignleft')); " which gave me the right look i am going for But i do not seem to be able to shrink the thumbnail down anyfurther then 'thumbnail' status which is like 80px by 80px. I am looking for 55px by 55px, do you know of a way to be able to include an exact thumbnail size within the: get_the_post_thumbnail( $post['ID'], 32); that you provided?

    Any additional feedback would be very helpful. Thank you.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.