Displaying popular posts
You can attach images to each post using “featured images” by first enabling featured images for your theme using add_theme_support(‘post-thumbnails’), and get_the_post_thumbnail() to display images. For example, to list 4 most commented posts with their featured image and title, you can do something like this: $posts = get_posts( array( ‘posts_per_page’ => 4, ‘order_by’ => ‘comment_count’ … Read more