WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. jbrewlet
    Member
    Posted 1 year 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.

    http://wordpress.org/extend/plugins/wp-most-popular/

  2. kanuharis
    Member
    Posted 1 year 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

    <?php
    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>
    
        <?php
    endforeach; endif;
    echo '</ul>';
    ?>

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic