Poti sa afisezi articole cu cele mai multe comentarii cu tot cu imaginea postata pentru aceasta punand urmatorul cod in template:
[php]
<?php $popular = new WP_Query(‘orderby=comment_count&posts_per_page=5’); ?>
<?php while ($popular->have_posts()) : $popular->the_post(); ?>
<?php $justanimage = get_post_meta($post->ID, ‘Image’, true);
if ($justanimage) { ?>
<img src="<?php echo get_post_meta($post->ID, "Image", true); ?>" alt="<?php the_title(); ?>" />
<?php } else { ?>
<img src="https://an-alternative-image.jpg" alt="" />
<?php } ?>
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<?php endwhile; ?>
[/php]