WP Most Popular
Feature Request: Featured Image (2 posts)

  1. jbrewlet
    Posted 2 years ago #

    Would love the option to show the featured photos of the most recent posts. This is probably a larger request than I realize, but it would be great!

    Thanks for the plugin also.


  2. kanuharis
    Posted 2 years ago #

    Its not a big thing as you think if you use template tag. Just add
    <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); ?></a>
    and use css to show the image the way you want.
    to change the thumbnail size check this link Click here

    the full code

    echo '<ul>';
    $posts = wmp_get_popular( array( 'limit' => 10, 'post_type' => 'post', 'range' => 'monthly' ) );
    global $post;
    if ( count( $posts ) > 0 ): foreach ( $posts as $post ):
        setup_postdata( $post );
        <li><a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('your_custom_thumbnail'); ?></a><a href="<?php the_permalink() ?>" title="<?php echo esc_attr(get_the_title() ? get_the_title() : get_the_ID()); ?>"><?php if ( get_the_title() ) the_title(); else the_ID(); ?></a></li>
    endforeach; endif;
    echo '</ul>';

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Most Popular
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic